Serhiy Storchaka <[email protected]> added the comment:
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
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue10544>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com