This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients docs@python, emilyemorehouse, ethan.furman, r.david.murray
Date 2016-06-02.20:10:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1464898221.11.0.044145661089.issue26829@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-06-02 20:10:21r.david.murraysetrecipients: + r.david.murray, docs@python, ethan.furman, emilyemorehouse
2016-06-02 20:10:21r.david.murraysetmessageid: <1464898221.11.0.044145661089.issue26829@psf.upfronthosting.co.za>
2016-06-02 20:10:21r.david.murraylinkissue26829 messages
2016-06-02 20:10:20r.david.murraycreate