New submission from Joshua Oreman :
On Python 3.9.0 with the new PEG parser, the following statement produces a
SyntaxError:
with contextlib.nullcontext(range(1, 5)) as (first, *rest, last):
print(first, rest, last)
On 3.8.x, or 3.9.0 with -X oldparser, it succeeds and prints "1 [2,
Joshua Oreman added the comment:
This doesn't appear to have been backported to 3.7, even though it's in 3.6.6
and 3.8.0a0.
--
nosy: +Joshua Oreman, lukasz.langa
___
Python tracker
<https://bugs.python.o
Joshua Oreman added the comment:
The problem appears to be occurring when the base class is subscripted, not
when it's inherited. I can reproduce this issue on Python 3.6.10 by just
evaluating Base[T].
'del Base.__slots__' after Base is constructed seems to work around the is
New submission from Joshua Oreman :
The current async generator finalization hooks are per-thread, but sometimes
you want different async generator semantics in different async tasks in the
same thread. This is currently challenging to implement using the thread-level
hooks. I'm propos
Joshua Oreman added the comment:
I also ran into this. My workaround was to use gc.get_referents() on the
async_generator_asend object, which returns a one-element list containing the
async generator object. I don't know if this is guaranteed or just happened to
work in the cases