summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-02-12 20:03:09 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-02-12 20:03:09 (GMT)
commit53dbe39b46ef42aeef12c6f46f8575a794e20440 (patch)
tree99f15bb4ba51d6e88ad50f462af0ed0235b1d6d5 /Doc/library
parent4513ef8b7a4a684deea0dda23a760f4596a1097c (diff)
downloadcpython-53dbe39b46ef42aeef12c6f46f8575a794e20440.zip
cpython-53dbe39b46ef42aeef12c6f46f8575a794e20440.tar.gz
cpython-53dbe39b46ef42aeef12c6f46f8575a794e20440.tar.bz2
Move UserList to collections.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/collections.rst48
-rw-r--r--Doc/library/numeric.rst2
-rw-r--r--Doc/library/userdict.rst52
3 files changed, 46 insertions, 56 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 493e22a..f70ccb6 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -1,9 +1,9 @@
-:mod:`collections` --- High-performance container datatypes
-===========================================================
+:mod:`collections` --- Container datatypes
+==========================================
.. module:: collections
- :synopsis: High-performance datatypes
+ :synopsis: Container datatypes
.. moduleauthor:: Raymond Hettinger <python@rcn.com>
.. sectionauthor:: Raymond Hettinger <python@rcn.com>
@@ -663,3 +663,45 @@ In addition to supporting the methods and operations of mappings,
.. attribute:: UserDict.data
A real dictionary used to store the contents of the :class:`UserDict` class.
+
+
+
+:class:`UserList` objects
+-------------------------
+
+This class acts as a wrapper around list objects. It is a useful base class
+for your own list-like classes which can inherit from them and override
+existing methods or add new ones. In this way, one can add new behaviors to
+lists.
+
+The need for this class has been partially supplanted by the ability to
+subclass directly from :class:`list`; however, this class can be easier
+to work with because the underlying list is accessible as an attribute.
+
+.. class:: UserList([list])
+
+ Class that simulates a list. The instance's contents are kept in a regular
+ list, which is accessible via the :attr:`data` attribute of :class:`UserList`
+ instances. The instance's contents are initially set to a copy of *list*,
+ defaulting to the empty list ``[]``. *list* can be any iterable, for
+ example a real Python list or a :class:`UserList` object.
+
+In addition to supporting the methods and operations of mutable sequences,
+:class:`UserList` instances provide the following attribute:
+
+.. attribute:: UserList.data
+
+ A real :class:`list` object used to store the contents of the
+ :class:`UserList` class.
+
+**Subclassing requirements:** Subclasses of :class:`UserList` are expect to
+offer a constructor which can be called with either no arguments or one
+argument. List operations which return a new sequence attempt to create an
+instance of the actual implementation class. To do so, it assumes that the
+constructor can be called with a single parameter, which is a sequence object
+used as a data source.
+
+If a derived class does not wish to comply with this requirement, all of the
+special methods supported by this class will need to be overridden; please
+consult the sources for information about the methods which need to be provided
+in that case.
diff --git a/Doc/library/numeric.rst b/Doc/library/numeric.rst
index 4c65a43..641f588 100644
--- a/Doc/library/numeric.rst
+++ b/Doc/library/numeric.rst
@@ -21,7 +21,7 @@ The following modules are documented in this chapter:
math.rst
cmath.rst
decimal.rst
- rational.rst
+ fractions.rst
random.rst
itertools.rst
functools.rst
diff --git a/Doc/library/userdict.rst b/Doc/library/userdict.rst
index 9b03f69..ebdec7c 100644
--- a/Doc/library/userdict.rst
+++ b/Doc/library/userdict.rst
@@ -1,55 +1,3 @@
-:mod:`UserList` --- Class wrapper for list objects
-==================================================
-
-.. module:: UserList
- :synopsis: Class wrapper for list objects.
-
-
-.. note::
-
- This module is available for backward compatibility only. If you are writing
- code that does not need to work with versions of Python earlier than Python 2.2,
- please consider subclassing directly from the built-in :class:`list` type.
-
-This module defines a class that acts as a wrapper around list objects. It is a
-useful base class for your own list-like classes, which can inherit from them
-and override existing methods or add new ones. In this way one can add new
-behaviors to lists.
-
-The :mod:`UserList` module defines the :class:`UserList` class:
-
-
-.. class:: UserList([list])
-
- Class that simulates a list. The instance's contents are kept in a regular
- list, which is accessible via the :attr:`data` attribute of
- :class:`UserList`
- instances. The instance's contents are initially set to a copy of *list*,
- defaulting to the empty list ``[]``. *list* can be any iterable, for
- example a real Python list or a :class:`UserList` object.
-
-In addition to supporting the methods and operations of mutable sequences (see
-section :ref:`typesseq`), :class:`UserList` instances provide the following
-attribute:
-
-
-.. attribute:: UserList.data
-
- A real Python list object used to store the contents of the :class:`UserList`
- class.
-
-**Subclassing requirements:** Subclasses of :class:`UserList` are expect to
-offer a constructor which can be called with either no arguments or one
-argument. List operations which return a new sequence attempt to create an
-instance of the actual implementation class. To do so, it assumes that the
-constructor can be called with a single parameter, which is a sequence object
-used as a data source.
-
-If a derived class does not wish to comply with this requirement, all of the
-special methods supported by this class will need to be overridden; please
-consult the sources for information about the methods which need to be provided
-in that case.
-
:mod:`UserString` --- Class wrapper for string objects
======================================================