Skip to content

Instantly share code, notes, and snippets.

@idrisr
Created September 9, 2021 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idrisr/487f7d01b5887617bf8685ec1dd48265 to your computer and use it in GitHub Desktop.
Save idrisr/487f7d01b5887617bf8685ec1dd48265 to your computer and use it in GitHub Desktop.
Singleton Pattern
>>> from traitlets.config.configurable import SingletonConfigurable
>>> class Foo(SingletonConfigurable): pass
>>> foo = Foo.instance()
>>> foo == Foo.instance()
True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment