[Twisted-Python] Problems with inlineCallback, Deferred, yield and Python 3 in buildbot
Phil Mayers
p.mayers at imperial.ac.uk
Wed Jan 25 11:06:59 MST 2017
On 24/01/2017 21:14, Glyph Lefkowitz wrote:
> I've encountered this before and quickly worked around it, but I think
> this might actually be a bug in python 3, or at least its documentation.
>
> The language docs officially say that a "list display" (which is what I
> believe we're looking at here) "yields a new list object". But that is
> not what I see here:
>
> >>> [(yield 1) for x in range(10)]
Related, see:
http://stackoverflow.com/questions/32139885/yield-in-list-comprehensions-and-generator-expressions
http://bugs.python.org/issue10544
Basically, don't use yield inside comprehensions if you don't want
weirdness, AFAICT :o/
More information about the Twisted-Python
mailing list