| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1449,8 +1449,9 @@ are always available. They are listed here in alphabetical order. | |||
| 1449 | 1449 | class name and becomes the :attr:`~class.__name__` attribute; the *bases* | |
| 1450 | 1450 | tuple itemizes the base classes and becomes the :attr:`~class.__bases__` | |
| 1451 | 1451 | attribute; and the *dict* dictionary is the namespace containing definitions | |
| 1452 | - for class body and becomes the :attr:`~object.__dict__` attribute. For | ||
| 1453 | - example, the following two statements create identical :class:`type` objects: | ||
| 1452 | + for class body and is copied to a standard dictionary to become the | ||
| 1453 | + :attr:`~object.__dict__` attribute. For example, the following two | ||
| 1454 | + statements create identical :class:`type` objects: | ||
| 1454 | 1455 | ||
| 1455 | 1456 | >>> class X: | |
| 1456 | 1457 | ... a = 1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1734,6 +1734,11 @@ After the class object is created, it is passed to the class decorators | |||
| 1734 | 1734 | included in the class definition (if any) and the resulting object is bound | |
| 1735 | 1735 | in the local namespace as the defined class. | |
| 1736 | 1736 | ||
| 1737 | + When a new class is created by ``type.__new__``, the object provided as the | ||
| 1738 | + namespace parameter is copied to a standard Python dictionary and the original | ||
| 1739 | + object is discarded. The new copy becomes the :attr:`~object.__dict__` attribute | ||
| 1740 | + of the class object. | ||
| 1741 | + | ||
| 1737 | 1742 | .. seealso:: | |
| 1738 | 1743 | ||
| 1739 | 1744 | :pep:`3135` - New super | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -999,6 +999,7 @@ Peter Moody | |||
| 999 | 999 | Paul Moore | |
| 1000 | 1000 | Ross Moore | |
| 1001 | 1001 | Ben Morgan | |
| 1002 | + Emily Morehouse | ||
| 1002 | 1003 | Derek Morr | |
| 1003 | 1004 | James A Morrison | |
| 1004 | 1005 | Martin Morrison | |
| Back | FazBrowse Home | New Git URL |
0 commit comments