Super-global variables in Python
I just saw a lovely idea in Python to create super-global variables.
That is variable that will be available somehow globally in all the packages.
It was done by creating attributes on the builtins module Like this:
import builtins builtins.answer = 42
Then you can use them like this:
import builtins import super_global print(builtins.answer)
My gut feeling is that this is not such a good idea.
Published on 2021-08-30