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 georg.brandl
Recipients georg.brandl
Date 2008-12-26.09:57:38
SpamBayes Score 0.0012462519
Marked as misclassified No
Message-id <1230285461.02.0.901310598804.issue4748@psf.upfronthosting.co.za>
In-reply-to
Content
With lambda, the ban on "return x" in generators can be evaded:

>>> x = lambda: ((yield 1), (yield 2))
>>> list(x())
[1, 2, (None, None)]
>>> dis.dis(x)
  1           0 LOAD_CONST               0 (1)
              3 YIELD_VALUE
              4 LOAD_CONST               1 (2)
              7 YIELD_VALUE
              8 BUILD_TUPLE              2
             11 RETURN_VALUE
History
Date User Action Args
2008-12-26 09:57:41georg.brandlsetrecipients: + georg.brandl
2008-12-26 09:57:41georg.brandlsetmessageid: <1230285461.02.0.901310598804.issue4748@psf.upfronthosting.co.za>
2008-12-26 09:57:38georg.brandllinkissue4748 messages
2008-12-26 09:57:38georg.brandlcreate