#26829: Clarify that namespace is copied to a new __dict__ in instance creation.

Patch by Emily Morehouse.
This commit is contained in:
R David Murray 2016-06-02 20:05:43 -04:00
parent a32c738ad7
commit dd4fcf52f4
3 changed files with 9 additions and 2 deletions

View file

@ -1449,8 +1449,9 @@ are always available. They are listed here in alphabetical order.
class name and becomes the :attr:`~class.__name__` attribute; the *bases*
tuple itemizes the base classes and becomes the :attr:`~class.__bases__`
attribute; and the *dict* dictionary is the namespace containing definitions
for class body and becomes the :attr:`~object.__dict__` attribute. For
example, the following two statements create identical :class:`type` objects:
for class body and is copied to a standard dictionary to become the
:attr:`~object.__dict__` attribute. For example, the following two
statements create identical :class:`type` objects:
>>> class X:
... a = 1