Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6c0f0d

Browse files
committed
#16210: merge with 3.2.
2 parents f0ef7fe + 837cd06 commit e6c0f0d

2 files changed

Lines changed: 12 additions & 15 deletions

File tree

Doc/library/functions.rst

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,29 +1323,25 @@ are always available. They are listed here in alphabetical order.
13231323

13241324

13251325
.. function:: type(object)
1326+
type(name, bases, dict)
13261327

13271328
.. index:: object: type
13281329

1329-
Return the type of an *object*. The return value is a type object and
1330-
generally the same object as returned by ``object.__class__``.
1330+
1331+
With one argument, return the type of an *object*. The return value is a
1332+
type object and generally the same object as returned by ``object.__class__``.
13311333

13321334
The :func:`isinstance` built-in function is recommended for testing the type
13331335
of an object, because it takes subclasses into account.
13341336

1335-
With three arguments, :func:`type` functions as a constructor as detailed
1336-
below.
1337-
1338-
1339-
.. function:: type(name, bases, dict)
1340-
:noindex:
13411337

1342-
Return a new type object. This is essentially a dynamic form of the
1343-
:keyword:`class` statement. The *name* string is the class name and becomes the
1344-
:attr:`__name__` attribute; the *bases* tuple itemizes the base classes and
1345-
becomes the :attr:`__bases__` attribute; and the *dict* dictionary is the
1346-
namespace containing definitions for class body and becomes the :attr:`__dict__`
1347-
attribute. For example, the following two statements create identical
1348-
:class:`type` objects:
1338+
With three arguments, return a new type object. This is essentially a
1339+
dynamic form of the :keyword:`class` statement. The *name* string is the
1340+
class name and becomes the :attr:`__name__` attribute; the *bases* tuple
1341+
itemizes the base classes and becomes the :attr:`__bases__` attribute;
1342+
and the *dict* dictionary is the namespace containing definitions for class
1343+
body and becomes the :attr:`__dict__` attribute. For example, the
1344+
following two statements create identical :class:`type` objects:
13491345

13501346
>>> class X:
13511347
... a = 1

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,7 @@ Iñigo Serna
10591059
Joakim Sernbrant
10601060
Roger D. Serwy
10611061
Jerry Seutter
1062+
Pete Sevander
10621063
Denis Severson
10631064
Ian Seyer
10641065
Ha Shao

0 commit comments

Comments
 (0)