New submission from Joy Diamond <python....@gmail.com>:
Fix the following in https://www.python.org/dev/peps/pep-3115/ REPLACE: """ def __new__(cls, name, bases, classdict): # Note that we replace the classdict with a regular # dict before passing it to the superclass, so that we # don't continue to record member names after the class # has been created. result = type.__new__(cls, name, bases, dict(classdict)) result.member_names = classdict.member_names return result """ WITH: """ def __new__(cls, name, bases, classdict): result = type.__new__(cls, name, bases, classdict) result.member_names = classdict.member_names return result """ REMOVING the incorrect comment & copying of `classdict` According to: https://docs.python.org/3/reference/datamodel.html#preparing-the-class-namespace "When a new class is created by type.__new__, the object provided as the namespace parameter is copied to a new ordered mapping and the original object is discarded." Hence there is no need to copy `classdict` ---------- messages: 329213 nosy: joydiamond priority: normal severity: normal status: open title: Fix PEP 3115 to NOT imply that the class dictionary is used in the final created class _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35158> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com