Use of a variable in parent loop

2QdxY4RzWzUUiLuE at potatochowder.com 2QdxY4RzWzUUiLuE at potatochowder.com
Sat Sep 26 23:07:27 EDT 2020


On 2020-09-27 at 03:36:48 +0800,
Stephane Tougard via Python-list <python-list at python.org> wrote:

> Anyway, there's no perfect language, the point is to know it ...

Yes.

> ... It's just confusing I still have to declare or not declare an
> object depending on the action I have with it.

As ChrisA noted, Python almost always Just Works without declarations.
If you find yourself with a lot of global and/or nonlocal statements,
perhaps you're [still] thinking in another language.


More information about the Python-list mailing list