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
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
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
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
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