Brice PARENT <cont...@brice.xyz> writes:

> Examples:
>
> with b = a + 1:
>     y = b + 2

I don't think that could work, because the with "arguments" should be
expressions, not statements. However, IIRC someone already suggested the
alternative

with a+1 as b:
    y = b + 2

but that clashes with the ordinary "context manager" syntax.

It's a pity "exec" is now a plain function, instead of a keyword as it was in
Py2, as that could allow

exec:
    y = b + 2
with: # or even "in:"
    b = a + 1

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
l...@metapensiero.it  |                 -- Fortunato Depero, 1929.

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to