Damien George <[email protected]> added the comment:
It looks like this change introduced a subtle, and maybe intended (?),
behavioural change.
Consider (from MicroPython's test suite):
def f():
n = 0
while True:
n = yield n + 1
print(n)
g = f()
try:
g.send(1)
except TypeError:
print("caught")
print(g.send(None))
print(g.send(100))
print(g.send(200))
This used to work prior to commit b37181e69209746adc2119c471599a1ea5faa6c8.
But after that commit it fails on the print(g.send(None)) because the generator
is now stopped.
----------
nosy: +dpgeorge
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue43683>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com