Message154020
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. |
|
Date |
User |
Action |
Args |
2012-02-23 00:27:45 | vstinner | set | recipients:
+ vstinner, pitrou |
2012-02-23 00:27:45 | vstinner | set | messageid: <1329956865.57.0.697177106628.issue14095@psf.upfronthosting.co.za> |
2012-02-23 00:27:44 | vstinner | link | issue14095 messages |
2012-02-23 00:27:44 | vstinner | create | |
|