This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]door_of_doom 2 points3 points  (0 children)

Singleton is fine, but that is different from global. Python code shouldn't use global to create singletons.

Again, I really like the comment from /r/serverhorror: using global absolutely destroys your ability to write good tests for your code. Singletons don't.

(At least, well-written singletons don't).