[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-10-27 Thread Damien George
Damien George added the comment: Thanks for confirming the bug. Sending non-None to a not-started generator could arguably be case (2), because that's exactly the semantics introduced by the commit that broke the test case :) Honestly I don't have a strong opinion on which way this goes

[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-10-20 Thread Damien George
Damien George 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

[issue30707] Incorrect description of "async with" in PEP492 and documentation

2017-06-19 Thread Damien George
New submission from Damien George: The behaviour of the "async with" statement in CPython does not match the description of it in PEP492, nor the language documentation. The implementation uses a try/except/finally block, while the PEP and documentation describe the behaviour u

[issue30707] Incorrect description of "async with" in PEP492 and documentation

2017-06-19 Thread Damien George
Changes by Damien George <damien.p.geo...@gmail.com>: -- assignee: docs@python components: Documentation nosy: Damien George, docs@python priority: normal severity: normal status: open title: Incorrect description of "async with" in PEP492 and documentation type: b

[issue27039] bytearray.remove cannot remove bytes with value greater than 127

2016-05-16 Thread Damien George
New submission from Damien George: The following code fails with a ValueError (but I expect it to succeed): >>> bytearray([128]).remove(128) Tested with Python 2.7.11 and 3.5.1. Probably it's a case of comparing a char (signed byte) with an unsigned value. -- components: In