Message154020
| 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: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 |
|