Skip to content

Instantly share code, notes, and snippets.

@thejeshgn
Created January 22, 2013 12:30
Show Gist options
  • Save thejeshgn/4594287 to your computer and use it in GitHub Desktop.
Save thejeshgn/4594287 to your computer and use it in GitHub Desktop.
Python singletomn using the state
class Borg:
__shared_state = {}
def __init__(self):
self.__dict__ = self.__shared_state
# and whatever else you want in your class -- that's all!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment