[New-bugs-announce] [issue46009] sending non-None values makes generator raise StopIteration on next access

Stanislav Syekirin report at bugs.python.org
Tue Dec 7 16:53:29 EST 2021


New submission from Stanislav Syekirin <syekirin at gmail.com>:

Tested with Python 3.10.1 on Linux and Python 3.10.0 on Windows.

The following code prints None in 3.9 and raises StopIteration without any additional information in 3.10:

    def f():
        yield
    
    x = f()
    
    try:
        x.send(0)
    except TypeError as e:
        print(e) # can't send non-None value to a just-started generator
    
    print(next(x))

----------
messages: 407975
nosy: Zabolekar
priority: normal
severity: normal
status: open
title: sending non-None values makes generator raise StopIteration on next access
type: behavior
versions: Python 3.10

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


More information about the New-bugs-announce mailing list