mirror of
https://github.com/bottlesdevs/Bottles.git
synced 2026-10-19 15:41:27 +08:00
8e12f6d0de
Co-authored-by: EmoonX <emoon@emoon.dev>
8 lines
225 B
Python
8 lines
225 B
Python
class Singleton(type):
|
|
_instances = {}
|
|
|
|
def __call__(cls, *args, **kwargs):
|
|
if cls not in cls._instances:
|
|
cls._instances[cls] = super().__call__(*args, **kwargs)
|
|
return cls._instances[cls]
|