[Python-checkins] cpython (merge 3.2 -> 3.3): #16210: merge with 3.2.
ezio.melotti
python-checkins at python.org
Wed Oct 24 22:07:57 CEST 2012
http://hg.python.org/cpython/rev/8f1d72106073
changeset: 79928:8f1d72106073
branch: 3.3
parent: 79923:4d99052f3d4c
parent: 79927:997ab4f1530f
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Wed Oct 24 23:06:56 2012 +0300
summary:
#16210: merge with 3.2.
files:
Doc/library/functions.rst | 26 +++++++++++---------------
Misc/ACKS | 1 +
2 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1323,29 +1323,25 @@
.. function:: type(object)
+ type(name, bases, dict)
.. index:: object: type
- Return the type of an *object*. The return value is a type object and
- generally the same object as returned by ``object.__class__``.
+
+ With one argument, return the type of an *object*. The return value is a
+ type object and generally the same object as returned by ``object.__class__``.
The :func:`isinstance` built-in function is recommended for testing the type
of an object, because it takes subclasses into account.
- With three arguments, :func:`type` functions as a constructor as detailed
- below.
-
-.. function:: type(name, bases, dict)
- :noindex:
-
- Return a new type object. This is essentially a dynamic form of the
- :keyword:`class` statement. The *name* string is the class name and becomes the
- :attr:`__name__` attribute; the *bases* tuple itemizes the base classes and
- becomes the :attr:`__bases__` attribute; and the *dict* dictionary is the
- namespace containing definitions for class body and becomes the :attr:`__dict__`
- attribute. For example, the following two statements create identical
- :class:`type` objects:
+ With three arguments, return a new type object. This is essentially a
+ dynamic form of the :keyword:`class` statement. The *name* string is the
+ class name and becomes the :attr:`__name__` attribute; the *bases* tuple
+ itemizes the base classes and becomes the :attr:`__bases__` attribute;
+ and the *dict* dictionary is the namespace containing definitions for class
+ body and becomes the :attr:`__dict__` attribute. For example, the
+ following two statements create identical :class:`type` objects:
>>> class X:
... a = 1
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1059,6 +1059,7 @@
Joakim Sernbrant
Roger D. Serwy
Jerry Seutter
+Pete Sevander
Denis Severson
Ian Seyer
Ha Shao
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list