2 ms·
If you're learning Python and are using locals() and globals() as anything more than a debugging tool... I'd venture to say you are doing something wrong ;) In
by btown 14y ago
If you're learning Python and are using locals() and globals() as anything more than a debugging tool... I'd venture to say you are doing something wrong ;)
In seriousness, any programmer will need to know that functions don't just magically appear... if they don't work, they'll need to know how to pull in some sort of library, or realize why those functions just don't make sense for the current environment (one could explain to a complete novice why it would be a security breach to allow I/O functions, for instance). Python is a language, not a standard library, just as C is C even if you don't #include <stdlib.h>.