@@ -1683,18 +1683,19 @@ are always available. They are listed here in alphabetical order.
1683
1683
1684
1684
1685
1685
With three arguments, return a new type object. This is essentially a
1686
- dynamic form of the :keyword: `class ` statement. The *name * string is the
1687
- class name and becomes the :attr: `~definition.__name__ ` attribute; the *bases *
1688
- tuple itemizes the base classes and becomes the :attr: `~class.__bases__ `
1689
- attribute; and the *dict * dictionary is the namespace containing definitions
1690
- for class body and is copied to a standard dictionary to become the
1691
- :attr: `~object.__dict__ ` attribute. For example, the following two
1692
- statements create identical :class: `type ` objects:
1686
+ dynamic form of the :keyword: `class ` statement. The *name * string is
1687
+ the class name and becomes the :attr: `~definition.__name__ ` attribute.
1688
+ The *bases * tuple contains the base classes and becomes the
1689
+ :attr: `~class.__bases__ ` attribute; if empty, :class: `object `, the
1690
+ ultimate base of all classes, is added. The *dict * dictionary contains
1691
+ attribute and method definitions for the class body; it may be copied
1692
+ or wrapped before becoming the :attr: `~object.__dict__ ` attribute.
1693
+ The following two statements create identical :class: `type ` objects:
1693
1694
1694
1695
>>> class X :
1695
1696
... a = 1
1696
1697
...
1697
- >>> X = type (' X' , (object , ), dict (a = 1 ))
1698
+ >>> X = type (' X' , (), dict (a = 1 ))
1698
1699
1699
1700
See also :ref: `bltin-type-objects `.
1700
1701
0 commit comments