[docs] [issue21533] built-in types dict docs - construct dict from iterable, not iterator

Wolfgang Maier report at bugs.python.org
Mon May 19 10:10:15 CEST 2014


New submission from Wolfgang Maier:

The docs for Python3.4 havethis to say about the arguments to the dict constructor:

class dict(**kwarg)
class dict(mapping, **kwarg)
class dict(iterable, **kwarg)

    Return a new dictionary initialized from an optional positional argument and a possibly empty set of keyword arguments.

    If no positional argument is given, an empty dictionary is created. If a positional argument is given and it is a mapping object, a dictionary is created with the same key-value pairs as the mapping object. Otherwise, the positional argument must be an iterator object. Each item in the iterable must itself be an iterator with exactly two objects. The first object of each item becomes a key in the new dictionary, and the second object the corresponding value. If a key occurs more than once, the last value for that key becomes the corresponding value in the new dictionary.

This paragraph uses the term iterator twice when it should talk about an iterable instead.
I'm attaching the patch for this.

Best,
Wolfgang

----------
assignee: docs at python
components: Documentation
files: dict_doc.patch
keywords: patch
messages: 218784
nosy: docs at python, wolma
priority: normal
severity: normal
status: open
title: built-in types dict docs - construct dict from iterable, not iterator
Added file: http://bugs.python.org/file35292/dict_doc.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21533>
_______________________________________


More information about the docs mailing list