[docs] [issue17422] language reference should specify restrictions on class namespace
report at bugs.python.org
Thu Mar 14 21:33:35 CET 2013
New submission from Eric Snow:
(related to PEP 422 and issue #17044)
The execution namespace from a class definition is passed as the third argument to the metaclass (see builtin___build_class__() in Python/bltinmodule.c). When applicable, which is almost always, the subsequent call to type.__new__() copies that namespace into a new dict which is in turn exposed via the class's __dict__.
This matters in the case where a metaclass with __prepare__() gets used (or the PEP 422 equivalent). The language reference should note that the object returned by __prepare__() is copied into a new dict when the class is finally created via the metaclass.
assignee: docs at python
nosy: docs at python, eric.snow, ncoghlan
stage: needs patch
title: language reference should specify restrictions on class namespace
versions: Python 3.4
Python tracker <report at bugs.python.org>
More information about the docs