New submission from STINNER Victor <[email protected]>:
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.
----------
messages: 154020
nosy: haypo, pitrou
priority: normal
severity: normal
status: open
title: type_new() removes __qualname__ from the input dictionary
versions: Python 3.3
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue14095>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com