This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author FrankMillman
Recipients FrankMillman, docs@python
Date 2015-03-16.08:50:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426495855.1.0.56894829498.issue23677@psf.upfronthosting.co.za>
In-reply-to
Content
This is from the documentation at Section 4.6.4. Lists

"""
Lists may be constructed in several ways:

Using a pair of square brackets to denote the empty list: []
Using square brackets, separating items with commas: [a], [a, b, c]
Using a list comprehension: [x for x in iterable]
Using the type constructor: list() or list(iterable)
"""

Comprehensions are mentioned as a constructor.

This is from the documentation at Section 4.10. Mapping Types

"""
Dictionaries can be created by placing a comma-separated list of key: value pairs within braces, for example: {'jack': 4098, 'sjoerd': 4127} or {4098: 'jack', 4127: 'sjoerd'}, or by 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.
"""

There is no mention of dictionary comprehensions.

For consistency, I believe that the documentation for Dicts and Sets should mention comprehensions.
History
Date User Action Args
2015-03-16 08:50:55FrankMillmansetrecipients: + FrankMillman, docs@python
2015-03-16 08:50:55FrankMillmansetmessageid: <1426495855.1.0.56894829498.issue23677@psf.upfronthosting.co.za>
2015-03-16 08:50:55FrankMillmanlinkissue23677 messages
2015-03-16 08:50:54FrankMillmancreate