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