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 vstinner
Recipients pitrou, vstinner
Date 2012-02-23.00:27:44
SpamBayes Score 1.2448605e-07
Marked as misclassified No
Message-id <1329956865.57.0.697177106628.issue14095@psf.upfronthosting.co.za>
In-reply-to
Content
The C function type_new() creates a copy the dictionary for __dict__ and modifies the copy... except for __qualname__: it does modify the input dictionary before the copy.
---
def f(): pass

d = {'__qualname__': 42, '__new__': f}
assert d['__new__'] is f
assert '__qualname__' in d
Enum = type.__new__(type, 'Enum', (), d)
assert d['__new__'] is f
assert '__qualname__' in d
---

I don't know if it is expected. If not, the copy should be done before.
History
Date User Action Args
2012-02-23 00:27:45vstinnersetrecipients: + vstinner, pitrou
2012-02-23 00:27:45vstinnersetmessageid: <1329956865.57.0.697177106628.issue14095@psf.upfronthosting.co.za>
2012-02-23 00:27:44vstinnerlinkissue14095 messages
2012-02-23 00:27:44vstinnercreate