summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2008-09-04 01:42:51 (GMT)
committerBarry Warsaw <barry@python.org>2008-09-04 01:42:51 (GMT)
commitecaab837b6ef36edf1840afdba1fbab747c049d7 (patch)
tree948112c5a3f7dc5e1ee7bc8b473a737328db96ec /Doc
parent6ecc5c19802b994b3b7033953361f6157b4bdd0d (diff)
downloadcpython-ecaab837b6ef36edf1840afdba1fbab747c049d7.zip
cpython-ecaab837b6ef36edf1840afdba1fbab747c049d7.tar.gz
cpython-ecaab837b6ef36edf1840afdba1fbab747c049d7.tar.bz2
Committing the patch in issue 2965, so that weakref dicts have a closer
interface to normal dictionaries. keys(), values() and items() still return iterators instead of views, but that can be fixed later (or not).
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/weakref.rst20
1 files changed, 5 insertions, 15 deletions
diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst
index bffa2ba..3681d81 100644
--- a/Doc/library/weakref.rst
+++ b/Doc/library/weakref.rst
@@ -152,14 +152,9 @@ references that will cause the garbage collector to keep the keys around longer
than needed.
-.. method:: WeakKeyDictionary.iterkeyrefs()
-
- Return an :term:`iterator` that yields the weak references to the keys.
-
-
.. method:: WeakKeyDictionary.keyrefs()
- Return a list of weak references to the keys.
+ Return an :term:`iterator` that yields the weak references to the keys.
.. class:: WeakValueDictionary([dict])
@@ -176,18 +171,13 @@ than needed.
magic" (as a side effect of garbage collection).
:class:`WeakValueDictionary` objects have the following additional methods.
-These method have the same issues as the :meth:`iterkeyrefs` and :meth:`keyrefs`
-methods of :class:`WeakKeyDictionary` objects.
-
-
-.. method:: WeakValueDictionary.itervaluerefs()
-
- Return an :term:`iterator` that yields the weak references to the values.
+These method have the same issues as the and :meth:`keyrefs` method of
+:class:`WeakKeyDictionary` objects.
.. method:: WeakValueDictionary.valuerefs()
- Return a list of weak references to the values.
+ Return an :term:`iterator` that yields the weak references to the values.
.. class:: WeakSet([elements])
@@ -290,7 +280,7 @@ the referent is accessed::
def __init__(self, ob, callback=None, **annotations):
super(ExtendedRef, self).__init__(ob, callback)
self.__counter = 0
- for k, v in annotations.iteritems():
+ for k, v in annotations.items():
setattr(self, k, v)
def __call__(self):