A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2017-February/147331.html below:

[Python-Dev] Generator objects and list comprehensions?

[Python-Dev] Generator objects and list comprehensions? [Python-Dev] Generator objects and list comprehensions?Anders Munch ajm at flonidan.dk
Thu Feb 2 05:17:57 EST 2017
Craig Rodrigues <rodrigc at freebsd.org>:
> Make this return a list on Python 3, like in Python 2:  [(yield 1) for x in range(10)] 

Give Python 2 a little more credit.

Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> [(yield 1) for x in range(10)]
  File "<stdin>", line 1
SyntaxError: 'yield' outside function

regards, Anders

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