[New-bugs-announce] [issue42725] PEP 563: Should the behavior change for yield/yield from's

Batuhan Taskaya report at bugs.python.org
Wed Dec 23 08:28:51 EST 2020


New submission from Batuhan Taskaya <isidentical at gmail.com>:

Since the annotations are processed just like all other expressions in the symbol table, the generated entries for functions etc. This would result with 

def foo():
    for number in range(5):
        foo: (yield number)
    return number

foo()

returning a generator / coroutine (depending on yield/yield from/await usage). Is this something we want to keep or maybe tweak the symbol table generator to not to handle annotations (since there are also more subtle issues regarding analysis of cell / free vars).

----------
messages: 383647
nosy: BTaskaya, gvanrossum
priority: normal
severity: normal
status: open
title: PEP 563: Should the behavior change for yield/yield from's

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


More information about the New-bugs-announce mailing list