diff options
author | Christian Heimes <christian@cheimes.de> | 2007-11-28 08:28:28 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-11-28 08:28:28 (GMT) |
commit | c9543e42330e5f339d6419eba6a8c5a61a39aeca (patch) | |
tree | ee3c677e808d015b6c142e1cca28337e08839818 /Doc | |
parent | ceee0773d262bfe876e40da927b03279ed9f8419 (diff) | |
download | cpython-c9543e42330e5f339d6419eba6a8c5a61a39aeca.zip cpython-c9543e42330e5f339d6419eba6a8c5a61a39aeca.tar.gz cpython-c9543e42330e5f339d6419eba6a8c5a61a39aeca.tar.bz2 |
Removed the new module
Removed a lot of types from the 'types' module that are available through builtins.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/datatypes.rst | 1 | ||||
-rw-r--r-- | Doc/library/new.rst | 55 | ||||
-rw-r--r-- | Doc/library/types.rst | 101 |
3 files changed, 4 insertions, 153 deletions
diff --git a/Doc/library/datatypes.rst b/Doc/library/datatypes.rst index 4cd042d..858af96 100644 --- a/Doc/library/datatypes.rst +++ b/Doc/library/datatypes.rst @@ -31,7 +31,6 @@ The following modules are documented in this chapter: weakref.rst userdict.rst types.rst - new.rst copy.rst pprint.rst repr.rst diff --git a/Doc/library/new.rst b/Doc/library/new.rst deleted file mode 100644 index 832dca6..0000000 --- a/Doc/library/new.rst +++ /dev/null @@ -1,55 +0,0 @@ - -:mod:`new` --- Creation of runtime internal objects -=================================================== - -.. module:: new - :synopsis: Interface to the creation of runtime implementation objects. -.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il> - - -The :mod:`new` module allows an interface to the interpreter object creation -functions. This is for use primarily in marshal-type functions, when a new -object needs to be created "magically" and not by using the regular creation -functions. This module provides a low-level interface to the interpreter, so -care must be exercised when using this module. It is possible to supply -non-sensical arguments which crash the interpreter when the object is used. - -The :mod:`new` module defines the following functions: - - -.. function:: instancemethod(function, instance) - - This function will return a method object, bound to *instance*. - *function* must be callable. - - .. XXX no unbound methods anymore - - -.. function:: function(code, globals[, name[, argdefs[, closure]]]) - - Returns a (Python) function with the given code and globals. If *name* is given, - it must be a string or ``None``. If it is a string, the function will have the - given name, otherwise the function name will be taken from ``code.co_name``. If - *argdefs* is given, it must be a tuple and will be used to determine the default - values of parameters. If *closure* is given, it must be ``None`` or a tuple of - cell objects containing objects to bind to the names in ``code.co_freevars``. - - -.. function:: code(argcount, nlocals, stacksize, flags, codestring, constants, names, varnames, filename, name, firstlineno, lnotab) - - This function is an interface to the :cfunc:`PyCode_New` C function. - - .. XXX This is still undocumented!!! - - -.. function:: module(name[, doc]) - - This function returns a new module object with name *name*. *name* must be a - string. The optional *doc* argument can have any type. - - -.. function:: classobj(name, baseclasses, dict) - - This function returns a new class object, with name *name*, derived from - *baseclasses* (which should be a tuple of classes) and with namespace *dict*. - Alias for the built-in :class:`type`. diff --git a/Doc/library/types.rst b/Doc/library/types.rst index d291fd0..4894067 100644 --- a/Doc/library/types.rst +++ b/Doc/library/types.rst @@ -33,77 +33,10 @@ Accordingly, the example above should be written as follows:: else: mylist.remove(item) -The module defines the following names: - - -.. data:: NoneType - - The type of ``None``. - - -.. data:: TypeType - ClassType - - .. index:: builtin: 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 - - The type of the :class:`bool` values ``True`` and ``False``; alias of the - built-in :class:`bool`. - - -.. data:: IntType - LongType - - The type of integers (e.g. ``1``); alias of the built-in :class:`int`. - - -.. data:: FloatType - - The type of floating point numbers (e.g. ``1.0``); alias of the built-in - :class:`float`. - - -.. data:: ComplexType - - 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 - - The type of character strings (e.g. ``'Spam'``); alias of the built-in - :class:`str`. - - -.. data:: TupleType - - The type of tuples (e.g. ``(1, 2, 3, 'Spam')``); alias of the built-in - :class:`tuple`. - - -.. data:: ListType - - The type of lists (e.g. ``[0, 1, 2, 3]``); alias of the built-in - :class:`list`. - - -.. data:: DictType - DictionaryType - - The type of dictionaries (e.g. ``{'Bacon': 1, 'Ham': 0}``); alias of the - built-in :class:`dict`. +Starting in Python 3.0 all types that are also available as builtins are no +longer exposed through the types module. +The module defines the following names: .. data:: FunctionType LambdaType @@ -141,19 +74,6 @@ The module defines the following names: The type of modules. -.. data:: SliceType - - .. index:: builtin: slice - - The type of objects returned by :func:`slice`; alias of the built-in - :class:`slice`. - - -.. data:: EllipsisType - - The type of ``Ellipsis``. - - .. data:: TracebackType The type of traceback objects such as found in ``sys.exc_info()[2]``. @@ -165,22 +85,9 @@ The module defines the following names: traceback object. -.. XXX! -.. data:: BufferType - - .. index:: builtin: buffer - - The type of buffer objects created by the :func:`buffer` function. - - .. data:: DictProxyType - The type of dict proxies, such as ``TypeType.__dict__``. - - -.. data:: NotImplementedType - - The type of ``NotImplemented`` + The type of dict proxies, such as ``type.__dict__``. .. data:: GetSetDescriptorType |