[issue33555] No SyntaxError raised for `return` with argument inside generator

FHTMitchell report at bugs.python.org
Thu May 17 08:21:26 EDT 2018


FHTMitchell <fergus.htm at gmail.com> added the comment:

Apologies if I wasn't clear. I understand that

def f():
    yield 1
    return

is valid python. What I'm saying, if you follow the link, is that

def f():
    yield 1
    return 2  # not the argument

should not be considered valid python according to PEP 255. This is implemented in python 2 but not in python 3.

----------
resolution: not a bug -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33555>
_______________________________________


More information about the Python-bugs-list mailing list