summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-04-04 23:58:19 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-04-04 23:58:19 (GMT)
commite42e2535c4a5d7f11693e598f4cd0844acc278b9 (patch)
treed37947ddab7eaf4b76c09acb8c8d161dcabe4507
parentef8bee41b14f52bfd21beecf4b4d954a84e41fdc (diff)
downloadcpython-e42e2535c4a5d7f11693e598f4cd0844acc278b9.zip
cpython-e42e2535c4a5d7f11693e598f4cd0844acc278b9.tar.gz
cpython-e42e2535c4a5d7f11693e598f4cd0844acc278b9.tar.bz2
Merged revisions 71203 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r71203 | benjamin.peterson | 2009-04-04 18:46:34 -0500 (Sat, 04 Apr 2009) | 1 line note how using iter* are unsafe while mutating and document iter(dict) ........
-rw-r--r--Doc/library/stdtypes.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index d07b10f..9b8cd35 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1897,6 +1897,11 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
.. versionadded:: 2.2
+ .. describe:: iter(d)
+
+ Return an iterator over the keys of the dictionary. This is a shortcut
+ for :meth:`iterkeys`.
+
.. method:: clear()
Remove all items from the dictionary.
@@ -1949,6 +1954,9 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
Return an iterator over the dictionary's ``(key, value)`` pairs. See the
note for :meth:`dict.items`.
+ Using :meth:`iteritems` while adding or deleting entries in the dictionary
+ will raise a :exc:`RuntimeError`.
+
.. versionadded:: 2.2
.. method:: iterkeys()
@@ -1956,6 +1964,9 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
Return an iterator over the dictionary's keys. See the note for
:meth:`dict.items`.
+ Using :meth:`iterkeys` while adding or deleting entries in the dictionary
+ will raise a :exc:`RuntimeError`.
+
.. versionadded:: 2.2
.. method:: itervalues()
@@ -1963,6 +1974,9 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098:
Return an iterator over the dictionary's values. See the note for
:meth:`dict.items`.
+ Using :meth:`itervalues` while adding or deleting entries in the
+ dictionary will raise a :exc:`RuntimeError`.
+
.. versionadded:: 2.2
.. method:: keys()