unitree_sdk2_python/unitree_sdk2py/utils/singleton.py

12 lines
247 B
Python
Raw Normal View History

2024-04-26 21:26:50 +08:00
class Singleton:
__instance = None
def __new__(cls, *args, **kwargs):
if cls.__instance is None:
cls.__instance = super(Singleton, cls).__new__(cls)
return cls.__instance
def __init__(self):
pass