On Sun, 29 Nov 2020 18:53:57 -0800 Christopher Barker firstname.lastname@example.org wrote:
This is a massively less ambitious idea, and doesn't solve the original problem, but:
I'd like to see a scope for names that are "obviously ;-)" meant to be short lived. At the moment that's the for loop "counters" and those created by context managers:
for i in something: # use i as usual more_code # now i is not defined
What other language(s) implement such a scoping discipline? I know of none.
On the other hand, block-scoped variables are implemented in:
The aim of the block scoping proposal is to make Python *not worse* than these other languages, instead of adding funny workarounds again.