Skip to content

Instantly share code, notes, and snippets.

@IlmirSharifullin
Created September 29, 2024 13:05
Show Gist options
  • Save IlmirSharifullin/39573a64425ab3d57cee29095658ff05 to your computer and use it in GitHub Desktop.
Save IlmirSharifullin/39573a64425ab3d57cee29095658ff05 to your computer and use it in GitHub Desktop.
class Singleton:
_instance = None
def __new__(cls):
if cls._instance is None:
print("Создание экземпляра")
cls._instance = super(Singleton, cls).__new__(cls)
return cls._instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment