>>>>> "GvR" == Guido van Rossum <guido@python.org> writes: GvR> Global outside a function would seem easy to detect (at least GvR> as easy as return outside a function), but you need to be GvR> careful: in a string passed to the exec statement, one could GvR> have distinct locals and globals, and then 'global x' outside a GvR> function would make sense. Also, 'global x' makes sense inside GvR> a class statement. IIRC I added a warning/error to the compiler about global at the module level, but later removed it because it was too hard (impossible?) to determine whether a block of code was being compiled to exec or being compiled for the body of a module. Anyone interested could check the CVS log for compile.c. GvR> But I'm not excited about this. A similar amount of analysis GvR> can discover assigning to a variable that's not used. Isn't GvR> that more useful? Using a name that's not defined anywhere. GvR> Etc. There are tons of these things. PyChecker watches for GvR> all of them. I'd prefer to make a project out of integrating GvR> PyChecker functionality into Python, eventually, rather than GvR> attacking random things one at a time I didn't check myself, because I agree with you on this point. Jeremy
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4