News for hackers. Stuff that matters.
Re:Global variables are bad (2013) by nine_k on Thursday July 26, 2018 @03:19AM (#17615661)
Some modules are unlike others. Try setting `sys.stdout` in one extremely local function, observe ripples everywhere. It's not common, fortunately; hacking `sys.path` is more common, and is sometimes done at import time.

With all its upsides, Python has a problematic global state story; it's easy to shoot yourself in the foot.

Re:Global variables are bad (2013) by __sr__ on Thursday July 26, 2018 @03:24AM (#17615681)
I am not saying that python globals are a great idea — just that they are not as horrible as they are in case of C and they they do have their uses — they just need to be used carefully. Of course, python makes it impossible to truly hide anything. In an ideal world, module level globals won’t be mutable outside the module.