summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-09-04 07:23:09 (GMT)
committerGeorg Brandl <georg@python.org>2007-09-04 07:23:09 (GMT)
commita1e9ef7a621520aa5574fe856a8ad40a69318ce2 (patch)
tree2f13a313c0c4c118c8632e18b048edff392fc540 /Doc
parent6911e3ce3f72af759908b869b73391ea00d328e2 (diff)
downloadcpython-a1e9ef7a621520aa5574fe856a8ad40a69318ce2.zip
cpython-a1e9ef7a621520aa5574fe856a8ad40a69318ce2.tar.gz
cpython-a1e9ef7a621520aa5574fe856a8ad40a69318ce2.tar.bz2
Fix up the types module docs.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/types.rst74
1 files changed, 17 insertions, 57 deletions
diff --git a/Doc/library/types.rst b/Doc/library/types.rst
index 6d499fb..ec271e4 100644
--- a/Doc/library/types.rst
+++ b/Doc/library/types.rst
@@ -42,11 +42,17 @@ The module defines the following names:
.. data:: TypeType
+ ClassType
.. index:: builtin: type
- The type of type objects (such as returned by :func:`type`); alias of the
- built-in :class:`type`.
+ The type of type objects (such as returned by :func:`type`) and user-defined
+ classes without metaclass; alias of the built-in :class:`type`.
+
+
+.. data:: ObjectType
+
+ Alias of the built-in :func:`object`.
.. data:: BooleanType
@@ -56,15 +62,11 @@ The module defines the following names:
.. data:: IntType
+ LongType
The type of integers (e.g. ``1``); alias of the built-in :class:`int`.
-.. data:: LongType
-
- The type of long integers (e.g. ``1L``); alias of the built-in :class:`long`.
-
-
.. data:: FloatType
The type of floating point numbers (e.g. ``1.0``); alias of the built-in
@@ -73,8 +75,9 @@ The module defines the following names:
.. data:: ComplexType
- The type of complex numbers (e.g. ``1.0j``). This is not defined if Python was
- built without complex number support.
+ The type of complex numbers (e.g. ``1.0j``); alias of the built-in
+ :class:`complex`. This is not defined if Python was built without complex
+ number support.
.. data:: StringType
@@ -96,26 +99,18 @@ The module defines the following names:
.. data:: DictType
+ DictionaryType
The type of dictionaries (e.g. ``{'Bacon': 1, 'Ham': 0}``); alias of the
built-in :class:`dict`.
-.. data:: DictionaryType
-
- An alternate name for ``DictType``.
-
-
.. data:: FunctionType
+ LambdaType
The type of user-defined functions and lambdas.
-.. data:: LambdaType
-
- An alternate name for ``FunctionType``.
-
-
.. data:: GeneratorType
The type of generator-iterator objects, produced by calling a generator
@@ -129,50 +124,23 @@ The module defines the following names:
The type for code objects such as returned by :func:`compile`.
-.. data:: ClassType
-
- The type of user-defined classes.
-
-
.. data:: MethodType
+ UnboundMethdType
The type of methods of user-defined class instances.
-.. data:: UnboundMethodType
-
- An alternate name for ``MethodType``.
-
-
.. data:: BuiltinFunctionType
+ BuiltinMethodType
The type of built-in functions like :func:`len` or :func:`sys.exit`.
-.. data:: BuiltinMethodType
-
- An alternate name for ``BuiltinFunction``.
-
-
.. data:: ModuleType
The type of modules.
-.. data:: FileType
-
- The type of open file objects such as ``sys.stdout``; alias of the built-in
- :class:`file`.
-
-
-.. data:: RangeType
-
- .. index:: builtin: range
-
- The type of range objects returned by :func:`range`; alias of the built-in
- :class:`range`.
-
-
.. data:: SliceType
.. index:: builtin: slice
@@ -197,6 +165,7 @@ The module defines the following names:
traceback object.
+.. XXX!
.. data:: BufferType
.. index:: builtin: buffer
@@ -228,12 +197,3 @@ The module defines the following names:
``datetime.timedelta.days``. This constant is not defined in implementations of
Python that do not have such extension types, so for portable code use
``hasattr(types, 'MemberDescriptorType')``.
-
-
-.. data:: StringTypes
-
- A sequence containing ``StringType`` and ``UnicodeType`` used to facilitate
- easier checking for any string object. Using this is more portable than using a
- sequence of the two string types constructed elsewhere since it only contains
- ``UnicodeType`` if it has been built in the running version of Python. For
- example: ``isinstance(s, types.StringTypes)``.