Python 2.1
Functions now define nested scopes. Currently, this feature must be enabled by including from _ _future_ _ import nested_scopes in your program. In future releases, this feature will be enabled by default.
Rich comparisons and the associated _ _le_ _(), _ _lt_ _(), _ _eq_ _(), _ _ne_ _(), _ _gt_ _(), and _ _ge_ _() methods.
d .popitem() method added to dictionaries.
f .xreadline() method added to files to support fast iteration over lines.
Functions and methods can now have attributes attached to them.
Support for weak references added. A new module, weakref, provides an interface.
▸; See Also weakref (124).
Warning framework added. The warnings module provides an interface.
▸; See Also warnings (121).
Case-sensitive import now supported on ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access