]> granicus.if.org Git - python/commitdiff
#16210: combine the two type() docs. Patch by Pete Sevander.
authorEzio Melotti <ezio.melotti@gmail.com>
Wed, 24 Oct 2012 20:01:30 +0000 (23:01 +0300)
committerEzio Melotti <ezio.melotti@gmail.com>
Wed, 24 Oct 2012 20:01:30 +0000 (23:01 +0300)
Doc/library/functions.rst
Misc/ACKS

index 84eed5c605a93dbab83a68305597091ced54ed55..936af5258549c0cef73a91f30fd59ac2441e8df2 100644 (file)
@@ -1426,26 +1426,21 @@ available.  They are listed here in alphabetical order.
 
 
 .. function:: type(object)
+              type(name, bases, dict)
 
    .. index:: object: type
 
-   Return the type of an *object*.  The return value is a type object.  The
-   :func:`isinstance` built-in function is recommended for testing the type of an
-   object.
-
-   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 one argument, return the type of an *object*.  The return value is a
+   type object.  The :func:`isinstance` built-in function is recommended for
+   testing the type of an object.
+
+   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(object):
       ...     a = 1
index 88b7ed0354702470142a08016f46b6c95f13d805..ba6be3ca68db188899de0d3d5bc749c9900990fe 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -884,6 +884,7 @@ Jiwon Seo
 Joakim Sernbrant
 Roger Serwy
 Jerry Seutter
+Pete Sevander
 Denis Severson
 Ian Seyer
 Ha Shao