[New-bugs-announce] [issue28310] Mixing yield and return with value is allowed

Markus Unterwaditzer report at bugs.python.org
Thu Sep 29 05:02:10 EDT 2016


New submission from Markus Unterwaditzer:

The attached example code raises a SyntaxError in Python 2, but is syntactically valid in Python 3. The return value is ignored and an empty generator is produced. I see no reason for this behavioral change.

----------
components: Interpreter Core
files: lol.py
messages: 277691
nosy: untitaker
priority: normal
severity: normal
status: open
title: Mixing yield and return with value is allowed
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44877/lol.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28310>
_______________________________________


More information about the New-bugs-announce mailing list