@@ -1703,18 +1703,19 @@ are always available. They are listed here in alphabetical order.
1703
1703
1704
1704
1705
1705
With three arguments, return a new type object. This is essentially a
1706
- dynamic form of the :keyword: `class ` statement. The *name * string is the
1707
- class name and becomes the :attr: `~definition.__name__ ` attribute; the *bases *
1708
- tuple itemizes the base classes and becomes the :attr: `~class.__bases__ `
1709
- attribute; and the *dict * dictionary is the namespace containing definitions
1710
- for class body and is copied to a standard dictionary to become the
1711
- :attr: `~object.__dict__ ` attribute. For example, the following two
1712
- statements create identical :class: `type ` objects:
1706
+ dynamic form of the :keyword: `class ` statement. The *name * string is
1707
+ the class name and becomes the :attr: `~definition.__name__ ` attribute.
1708
+ The *bases * tuple contains the base classes and becomes the
1709
+ :attr: `~class.__bases__ ` attribute; if empty, :class: `object `, the
1710
+ ultimate base of all classes, is added. The *dict * dictionary contains
1711
+ attribute and method definitions for the class body; it may be copied
1712
+ or wrapped before becoming the :attr: `~object.__dict__ ` attribute.
1713
+ The following two statements create identical :class: `type ` objects:
1713
1714
1714
1715
>>> class X :
1715
1716
... a = 1
1716
1717
...
1717
- >>> X = type (' X' , (object , ), dict (a = 1 ))
1718
+ >>> X = type (' X' , (), dict (a = 1 ))
1718
1719
1719
1720
See also :ref: `bltin-type-objects `.
1720
1721
0 commit comments