Skip to main content

All Questions

Filter by
Sorted by
Tagged with
5 votes
1 answer
12k views

Using singletons in Python (Django)

I was suggested to define a singleton in Python in the following way: class Controller: pass # ... controller = Controller() However, this way, controller cannot be replaced with a derived ...
porton's user avatar
  • 791