You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.
@wrapt.decorator(enabled=ENABLED)
def singleton(wrapped, instance, args, kwargs):
global INSTANCE
if wrapped not in INSTANCE:
INSTANCE[wrapped] = wrapped(*args, **kwargs)
return INSTANCE[wrapped]
继承时使用 super().init()
The text was updated successfully, but these errors were encountered:
import wrapt
INSTANCE = {}
ENABLED = True
@wrapt.decorator(enabled=ENABLED)
def singleton(wrapped, instance, args, kwargs):
global INSTANCE
if wrapped not in INSTANCE:
INSTANCE[wrapped] = wrapped(*args, **kwargs)
return INSTANCE[wrapped]
继承时使用 super().init()
The text was updated successfully, but these errors were encountered: