languages/

Syntax, runtimes, compilers, JITs, type systems and memory management.

5 results
languages/reference-counting-how-python-knows-when-to-throw-an-object-away.md Reference counting: how Python knows when to throw an object away You never tell Python to free memory, yet unused objects disappear. How does it know when one is finished with? CPython keeps a tally on… 5 min read · 28 Oct languages/generators-how-a-python-function-can-pause-in-the-middle-and-pick-up-w.md Generators: how a Python function can pause in the middle and pick up where it left off A generator is a Python function that can pause halfway, hand you a value, and carry on later from the same line with its variables intact… 4 min read · 25 Oct languages/python-default-arguments-why-a-function-remembers-the-last-call.md Python default arguments: why a function remembers the last call Call a small Python function twice and the second call remembers the first. The cause is a default value like `basket=[]`, which Python… 4 min read · 13 Oct languages/why-does-0-1-0-2-give-0-30000000000000004-in-python.md Why does 0.1 + 0.2 give 0.30000000000000004 in Python? Type 0.1 + 0.2 into Python and you get 0.30000000000000004. It is not a bug: computers store fractions in binary, and one tenth has no… 4 min read · 4 Oct languages/what-a-variable-really-is-python-names-values-and-the-sign.md What a variable really is: Python names, values and the = sign In Python, a variable isn't a box that holds a value. It's a name tag tied to a value that lives on its own. That one picture explains why… 7 min read · 1 Oct