|
|
|
|
|
by Etherlord87
1030 days ago
|
|
In Python every module is an object. It therefore makes less sense (in less situations it makes sense) to use classes, and a 'global' is a variable global to the module. It's like having a class, and calling attributes of the class 'globals', because they can be accessed by all methods of the class. This and the fact Python is often used in the context of writing simple utilities, where globals (even without the defense above) are perfectly fine (because it's not a huge codebase with namespace collisions etc.). Using absolute axioms like "globals are always bad" and religiously applying them is a toxic attitude in my opinion. |
|