diff --git a/tests/tricky_cases/test_falsy_instances.py b/tests/tricky_cases/test_falsy_instances.py index 5d98e55..c0f453c 100644 --- a/tests/tricky_cases/test_falsy_instances.py +++ b/tests/tricky_cases/test_falsy_instances.py @@ -20,7 +20,7 @@ async def create_async_resource() -> typing.AsyncIterator[dict[str, typing.Any]] class TrickyDIContainer(BaseContainer): - singleton = providers.Singleton(list) + singleton = providers.Singleton(list[object]) sync_resource = providers.Resource(create_sync_resource) async_resource = providers.Resource(create_async_resource) diff --git a/that_depends/providers/factories.py b/that_depends/providers/factories.py index a4370c4..a3a1094 100644 --- a/that_depends/providers/factories.py +++ b/that_depends/providers/factories.py @@ -10,7 +10,7 @@ class Factory(AbstractFactory[T_co]): __slots__ = "_factory", "_args", "_kwargs", "_override" - def __init__(self, factory: type[T_co] | typing.Callable[P, T_co], *args: P.args, **kwargs: P.kwargs) -> None: + def __init__(self, factory: typing.Callable[P, T_co], *args: P.args, **kwargs: P.kwargs) -> None: super().__init__() self._factory: typing.Final = factory self._args: typing.Final = args diff --git a/that_depends/providers/singleton.py b/that_depends/providers/singleton.py index d1d2a34..3b62895 100644 --- a/that_depends/providers/singleton.py +++ b/that_depends/providers/singleton.py @@ -11,7 +11,7 @@ class Singleton(AbstractProvider[T_co]): __slots__ = "_factory", "_args", "_kwargs", "_override", "_instance", "_resolving_lock" - def __init__(self, factory: type[T_co] | typing.Callable[P, T_co], *args: P.args, **kwargs: P.kwargs) -> None: + def __init__(self, factory: typing.Callable[P, T_co], *args: P.args, **kwargs: P.kwargs) -> None: super().__init__() self._factory: typing.Final = factory self._args: typing.Final = args