[issue17421] Drop restriction that meta.__prepare__() must return a dict (subclass)

Caleb Donovick report at bugs.python.org
Tue Mar 12 18:17:10 EDT 2019


Caleb Donovick <donovick at cs.stanford.edu> added the comment:

In my mind this seems like a bug. PEP 3115 states:
'''
__prepare__ returns a dictionary-like object which is used to store the class member definitions during evaluation of the class body. In other words, the class body is evaluated as a function block (just like it is now), except that the local variables dictionary is replaced by the dictionary returned from __prepare__. This dictionary object can be a regular dictionary or a custom mapping type.
'''

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue17421>
_______________________________________


More information about the Python-bugs-list mailing list