Resolution of SF bug # 446645 changes the semantics for __dict__ when
deleting it or getting an attribute before any have been set. Previously, __dict__ could be None or {}, but now it must be a dictionary (can never be None), and del'ing it is illegal. Code changes to be made soon.
This commit is contained in:
parent
5b87828901
commit
d4979cd62a
|
@ -55,10 +55,10 @@ Proposal
|
|||
approaches in subsequent versions of Python.
|
||||
|
||||
A function object's __dict__ can also be set, but only to a
|
||||
dictionary object or None (e.g. setting __dict__ to UserDict
|
||||
raises a TypeError). Deleting a function's __dict__ attribute is
|
||||
equivalent to setting it to None. If no function attributes have
|
||||
ever been set, the function's __dict__ will be None.
|
||||
dictionary object. Deleting a function's __dict__, or setting it
|
||||
to anything other than a concrete dictionary object results in a
|
||||
TypeError. If no function attributes have ever been set, the
|
||||
function's __dict__ will be empty.
|
||||
|
||||
|
||||
Examples
|
||||
|
|
Loading…
Reference in New Issue