7 lines
98 B
Python
7 lines
98 B
Python
from typing import TypeVar
|
|
|
|
T = TypeVar("T")
|
|
|
|
|
|
def singleton(cls: type[T]) -> T:
|
|
return cls()
|