Python handles globals badly.

Ian Kelly ian.g.kelly at gmail.com
Tue Sep 8 14:09:09 EDT 2015


On Tue, Sep 8, 2015 at 11:53 AM,  <tdev at freenet.de> wrote:
> -- Comparison with Javscript:
> Saying that Javascript and LUA does it samewise seems not correct
> from reading the thread.
> LUA is said it has it vice versa: local instead of a global
> But Javascript does have neither local nor global keyword so far I know,
> but has also a local scope (block scope).

In Javascript the keyword is "var", not "local", but it amounts to the
same thing: this variable is local, and if you don't use it then your
variable is not local.

> so, e.g. the first indent has 1 tab to the right, the second 2 spaces to the right.
> Why I am not free about this? Context is clear for me.

It's clear for you in your particular editor configuration. In
somebody else's editor who has tabs configured differently, it may
appear completely different. The compiler has no way of knowing what
your editor's tab settings are, so it considers the indentation
ambiguous.

> I would rather say, this would enhance the power and flexibility of the Python language even further.
> Especially from the scripting point of view (without harm Python hardliner)
> And by the way, I still believe that these changes would let Python overrun Javascript and PHP.
> There would practically no more any reasons for Javascript+NodeJS and especially PHP.
> I even think, a huge wave of developers would change then to Python.
> Including webhosters which I think did not know or want not know anything about Python 3.x.

I think that you greatly exaggerate the impact of these changes, which
are all quite cosmetic in nature.



More information about the Python-list mailing list