Issue 1166582: IterableUserDict not in docs (original) (raw)
There is no mention of UserDict.IterableUserDict in the docs (3.7 UserDict). Here is a suggested rewrite:
class UserDict( [initialdata]) Class that simulates a dictionary. The instance's contents are kept in a regular dictionary, which is accessible via the data attribute of UserDict instances. If initialdata is provided, data is initialized with its contents; note that a reference to initialdata will not be kept, allowing it be used for other purposes. Note: For backward compatibility, instances of UserDict are not iterable.
class IterableUserDict( [initialdata]) Subclass of UserDict that supports direct iteration (e.g. "for key in myDict").
In addition to supporting the methods and operations of mappings (see section 2.3.8), UserDict and IterableUserDict instances provide the following attribute: