Skip to content

Instantly share code, notes, and snippets.

@drgarcia1986
Created March 11, 2014 19:55
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 drgarcia1986/9493731 to your computer and use it in GitHub Desktop.
Save drgarcia1986/9493731 to your computer and use it in GitHub Desktop.
Esqueleto para criação de uma classe Singleton em Python
class MyClass:
__instance = None
@staticmethod
def instance():
if not MyClass.__instance:
MyClass.__instance = MyClass()
return MyClass.__instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment