[issue17422] language reference should specify restrictions on class namespace
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[1] should note that the object returned by __prepare__() is copied into a new dict when the class is finally created via the metaclass.
[1] http://docs.python.org/3.4/reference/datamodel.html#customizing-class-creati...
----------
assignee: docs@python
components: Documentation
messages: 184188
nosy: docs@python, eric.snow, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: language reference should specify restrictions on class namespace
type: enhancement
versions: Python 3.4
_______________________________________
Python tracker
Changes by Daniel Urban
Changes by Ethan Furman
Changes by Ethan Furman
Changes by Ethan Furman
Change by Caleb Donovick
Change by Ananthakrishnan
Ananthakrishnan
Guido van Rossum
Change by Guido van Rossum
Change by miss-islington
Change by miss-islington
miss-islington
miss-islington
Eric Snow
Guido van Rossum
Caleb Donovick
Change by Caleb Donovick
Change by Guido van Rossum
miss-islington
Change by miss-islington
Change by miss-islington
miss-islington
miss-islington
Eric Snow
Ned Deily
participants (8)
-
Ananthakrishnan
-
Caleb Donovick
-
Daniel Urban
-
Eric Snow
-
Ethan Furman
-
Guido van Rossum
-
miss-islington
-
Ned Deily