Hello, On Sun, 29 Nov 2020 18:53:57 -0800 Christopher Barker <python...@gmail.com> 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: * C * C++ * Java * Rust * Lua * JavaScript (not by default, as opt-in) * Scheme * Common Lisp (as opt-in) * ML * Ocaml * Haskell * very long list of other languages... The aim of the block scoping proposal is to make Python *not worse* than these other languages, instead of adding funny workarounds again. [] -- Best regards, Paul mailto:pmis...@gmail.com _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/4RXUCIMGP5V4XZTQRFIKR7UZNO5DLVDT/ Code of Conduct: http://python.org/psf/codeofconduct/