3 ms·
Python has implicit declarations, which lead to a world of hurt because you can't directly modify variables in arbitrary scopes. Python 3 has nonlocal, but that
by sid0 15y ago
Python has implicit declarations, which lead to a world of hurt because you can't directly modify variables in arbitrary scopes. Python 3 has nonlocal, but that only extends the number of function scopes you can refer to to three.
I think having implicit declarations is probably the worst mistake Python made. It just makes things so much more confusing.
- sid0 15y agoSorry, I made a mistake: nonlocal gives you as much power as usual closures. I still stand by my statement that implicit declarations make things very confusing.