Commits

Benjamin Peterson committed d900246

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)
........

  • Participants
  • Parent commits 7c2a04e
  • Branches 2.6

Comments (0)

Files changed (1)

Doc/library/stdtypes.rst

 
       .. 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.
       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()
       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()
       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()