Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
390c2582
Commit
390c2582
authored
May 26, 2008
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove remaining references to UserDict module.
parent
81a882f0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
21 deletions
+20
-21
Doc/library/shelve.rst
Doc/library/shelve.rst
+2
-2
Doc/reference/datamodel.rst
Doc/reference/datamodel.rst
+18
-19
No files found.
Doc/library/shelve.rst
View file @
390c2582
...
@@ -80,8 +80,8 @@ Restrictions
...
@@ -80,8 +80,8 @@ Restrictions
.. class:: Shelf(dict[, protocol=None[, writeback=False]])
.. class:: Shelf(dict[, protocol=None[, writeback=False]])
A subclass of :class:`
UserDict.DictMixin` which stores pickled values in the
A subclass of :class:`
collections.MutableMapping` which stores pickled values
*dict* object.
in the
*dict* object.
By default, version 0 pickles are used to serialize values. The version of the
By default, version 0 pickles are used to serialize values. The version of the
pickle protocol can be specified with the *protocol* parameter. See the
pickle protocol can be specified with the *protocol* parameter. See the
...
...
Doc/reference/datamodel.rst
View file @
390c2582
...
@@ -1554,26 +1554,25 @@ either to emulate a sequence or to emulate a mapping; the difference is that for
...
@@ -1554,26 +1554,25 @@ either to emulate a sequence or to emulate a mapping; the difference is that for
a sequence, the allowable keys should be the integers *k* for which ``0 <= k <
a sequence, the allowable keys should be the integers *k* for which ``0 <= k <
N`` where *N* is the length of the sequence, or slice objects, which define a
N`` where *N* is the length of the sequence, or slice objects, which define a
range of items. It is also recommended that mappings provide the methods
range of items. It is also recommended that mappings provide the methods
:meth:`keys`, :meth:`values`, :meth:`items`, :meth:`get`,
:meth:`keys`, :meth:`values`, :meth:`items`, :meth:`get`, :meth:`clear`,
:meth:`clear`, :meth:`setdefault`,
:meth:`setdefault`, :meth:`pop`, :meth:`popitem`, :meth:`copy`, and
:meth:`pop`, :meth:`popitem`, :meth:`copy`, and
:meth:`update` behaving similar to those for Python's standard dictionary
:meth:`update` behaving similar to those for Python's standard dictionary
objects. The :mod:`
UserDict` module provides a :class:`DictMixin` class to help
objects. The :mod:`
collections` module provides a :class:`MutableMapping`
create those methods from a base set of :meth:`__getitem__`,
abstract base class to help create those methods from a base set of
:meth:`__
setitem__`, :meth:`__delitem__`, and :meth:`keys`. Mutable sequences
:meth:`__
getitem__`, :meth:`__setitem__`, :meth:`__delitem__`, and :meth:`keys`.
should provide methods :meth:`append`, :meth:`count`, :meth:`index
`,
Mutable sequences should provide methods :meth:`append`, :meth:`count
`,
:meth:`
extend`, :meth:`insert`, :meth:`pop`, :meth:`remove`, :meth:`reverse` and
:meth:`
index`, :meth:`extend`, :meth:`insert`, :meth:`pop`, :meth:`remove`,
:meth:`
sort`, like Python standard list objects. Finally, sequence types should
:meth:`
reverse` and :meth:`sort`, like Python standard list objects. Finally,
implement addition (meaning concatenation) and multiplication (meaning
sequence types should implement addition (meaning concatenation) and
repetition) by defining the methods :meth:`__add__`, :meth:`__r
add__`,
multiplication (meaning repetition) by defining the methods :meth:`__
add__`,
:meth:`__
iadd__`, :meth:`__mul__`, :meth:`__rmul__` and :meth:`__imul__`
:meth:`__
radd__`, :meth:`__iadd__`, :meth:`__mul__`, :meth:`__rmul__` and
described below; they should not define other numerical operators. It is
:meth:`__imul__` described below; they should not define other numerical
recommended that both mappings and sequences implement the :meth:`__contains__`
operators. It is recommended that both mappings and sequences implement the
method to allow efficient use of the ``in`` operator; for mappings, ``in``
:meth:`__contains__` method to allow efficient use of the ``in`` operator; for
should search the mapping's keys; for sequences, it should search
mappings, ``in`` should search the mapping's keys; for sequences, it should
through the values. It is further recommended that both mappings and sequences
search through the values. It is further recommended that both mappings and
implement the :meth:`__iter__` method to allow efficient iteration through the
sequences implement the :meth:`__iter__` method to allow efficient iteration
container; for mappings, :meth:`__iter__` should be the same as
through the
container; for mappings, :meth:`__iter__` should be the same as
:meth:`keys`; for sequences, it should iterate through the values.
:meth:`keys`; for sequences, it should iterate through the values.
.. method:: object.__len__(self)
.. method:: object.__len__(self)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment