A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2017-January/147240.html below:

[Python-Dev] Generator objects and list comprehensions?

[Python-Dev] Generator objects and list comprehensions? [Python-Dev] Generator objects and list comprehensions?Craig Rodrigues rodrigc at freebsd.org
Wed Jan 25 00:38:44 EST 2017
Hi,

Glyph pointed this out to me here:
http://twistedmatrix.com/pipermail/twisted-python/2017-January/031106.html

If I do this on Python 3.6:

>>  [(yield 1) for x in range(10)]
<generator object <listcomp> at 0x10cd210f8>

If I understand this:
https://docs.python.org/3/reference/expressions.html#list-displays
then this is a list display and should give a list, not a generator object.
Is there a bug in Python, or does the documentation need to be updated?

--
Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20170124/117a2eb4/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4