June 2017
Beginner
352 pages
8h 39m
English
Python object references
Think of Python working in terms of named references to objects rather than variables and values.
Assignment doesn't put a value in a box. It attaches a name tag to an object.
Assigning from one reference to another puts two name tags on the same object.
The Python garbage collector will reclaim unreachable objects - those objects with no name tag.
Object identity and equivalence
The id() function returns a unique and constant identifier but should rarely, if ever, be used in production.
The is operator determines equality of identity. That is, whether two names refer to the same object.
We can test for equivalence using the double-equals operator.
Function arguments and return values ...
Read now
Unlock full access