Objects, References and Identity
Everything in Python is an object with a type, an identity and a value. Names are labels bound to objects, and almost every surprising behaviour follo...
Objects and references, identity, shallow and deep copying, reference counting, garbage collection and bytecode.
4 notes
Everything in Python is an object with a type, an identity and a value. Names are labels bound to objects, and almost every surprising behaviour follo...
Assignment shares, a shallow copy duplicates one level, and a deep copy duplicates everything. Choosing the wrong one is one of the most common source...
Python frees an object the moment nothing refers to it. A second collector exists solely to find reference cycles, which counting alone can never recl...
Compilation, the code object, the stack machine and the frame. A closer look at what the interpreter is actually doing while your program runs.