Author serhiy.storchaka
Recipients Inyeol.Lee, Jim Fasarakis-Hilliard, belopolsky, benjamin.peterson, danielsh, emptysquare, erickt, esc24, georg.brandl, glyph, gvanrossum, ncoghlan, rhettinger, serhiy.storchaka, yselivanov
Date 2017-11-27.11:20:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1511781619.48.0.213398074469.issue10544@psf.upfronthosting.co.za>
In-reply-to
Content
Note that the DeprecationWarning exception is replaced with a SyntaxError to get a more accurate error report.

$ cat yield-gen.py 
def f():
    return ((yield x) for x in range(3))

$ ./python -Wd yield-gen.py
yield-gen.py:2: DeprecationWarning: 'yield' inside generator expression
  return ((yield x) for x in range(3))

$ ./python -We yield-gen.py
  File "yield-gen.py", line 2
    return ((yield x) for x in range(3))
           ^
SyntaxError: 'yield' inside generator expression


Without this replacement the result would be:

$ ./python -We yield-gen.py
DeprecationWarning: 'yield' inside generator expression
History
Date User Action Args
2017-11-27 11:20:19serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, georg.brandl, rhettinger, ncoghlan, belopolsky, benjamin.peterson, erickt, glyph, Inyeol.Lee, yselivanov, esc24, danielsh, emptysquare, Jim Fasarakis-Hilliard
2017-11-27 11:20:19serhiy.storchakasetmessageid: <1511781619.48.0.213398074469.issue10544@psf.upfronthosting.co.za>
2017-11-27 11:20:19serhiy.storchakalinkissue10544 messages
2017-11-27 11:20:19serhiy.storchakacreate