R. David Murray added the comment:
Your suggested wording isn't correct, I'm afraid. This subject is complex and
somewhat obscure...I checked with Ethan to make sure my interpretation was
correct. The problem this issue is addressing is the fact that when
type.__new__ is called (as in the metaclass example), whatever is passed in as
the namespace has its *contents* copied into a new, standard python dict, and
the original namespace object is discarded. The metaclass example does this
explicitly (by doing dict(namespace), but in fact type.__new__ does it
implicitly (which IMO makes that example a bit confusing).
Also, that namespace is the only state. The metaclass example obscures that by
doing an attribute assignment after calling type.__new__, but that attribute
assignment is actually updating the __dict__ of the new object ('result'),
which is that new python dict containing the contents of namespace.
----------
nosy: +r.david.murray
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue26829>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com