Re:Untyped Python: The Python That Was
by WesolyKubeczek on Sunday December 03, 2023 @02:31AM
(#38505508)
The act of assigning is creating a variable; the act of using it will complain about an unbound variable.
Perl in non-strict mode, PHP last I touched it, Bourne-style shells will just go “yeah, whatever, here’s an empty string”.
But saying that Python "will complain about unbound variables instead of silently creating them" is simply incorrect. One of the defining characteristics of Python's variable scope is that assigning to a name always creates it in the current scope; there's no other way to declare a variable. And that's all I'm trying to demonstrate here.