modern-di 0.7.1__py3-none-any.whl → 0.7.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of modern-di might be problematic. Click here for more details.

@@ -9,16 +9,21 @@ T_co = typing.TypeVar("T_co", covariant=True)
9
9
  P = typing.ParamSpec("P")
10
10
 
11
11
 
12
- class InjectedFactory(typing.Generic[T_co]):
13
- __slots__ = ("_factory_provider",)
12
+ class InjectedFactory(AbstractProvider[T_co]):
13
+ __slots__ = [*AbstractProvider.BASE_SLOTS, "_factory_provider"]
14
14
 
15
15
  def __init__(self, factory_provider: AbstractProvider[T_co]) -> None:
16
+ super().__init__(factory_provider.scope)
16
17
  self._factory_provider = factory_provider
17
18
 
18
- async def async_resolve(self, container: Container) -> typing.Callable[[], T_co]:
19
+ async def async_resolve(self, container: Container) -> typing.Callable[[], T_co]: # type: ignore[override]
19
20
  await self._factory_provider.async_resolve(container)
20
21
  return functools.partial(self._factory_provider.sync_resolve, container)
21
22
 
22
- def sync_resolve(self, container: Container) -> typing.Callable[[], T_co]:
23
+ def sync_resolve(self, container: Container) -> typing.Callable[[], T_co]: # type: ignore[override]
23
24
  self._factory_provider.sync_resolve(container)
24
25
  return functools.partial(self._factory_provider.sync_resolve, container)
26
+
27
+ @property
28
+ def cast(self) -> typing.Callable[[], T_co]: # type: ignore[override]
29
+ return typing.cast(typing.Callable[[], T_co], self)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: modern-di
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Dependency Injection framework with IOC-container and scopes
5
5
  Project-URL: repository, https://github.com/modern-python/modern-di
6
6
  Project-URL: docs, https://modern-di.readthedocs.io
@@ -10,11 +10,11 @@ modern_di/providers/container_provider.py,sha256=r5IEQXgKtPwvHvbqkbPnmGyDGGCCjok
10
10
  modern_di/providers/context_adapter.py,sha256=_b1x3ToQPWT-9KkDioFhw1W8Q1VXZYUnczfYzMTobVA,760
11
11
  modern_di/providers/dict.py,sha256=nCU9iaqteYHDbILAfhrdnbMgS9_emE4MS7Xn2VoUlPo,858
12
12
  modern_di/providers/factory.py,sha256=NozbrprJlRJPWSNdvKR0kOwPt1Q9i_ZLJTPOfzdDDJo,1359
13
- modern_di/providers/injected_factory.py,sha256=B4dXr4uXN00DA_cd9bnXf8Ha4B7I6YhYigGoPuIuzlM,853
13
+ modern_di/providers/injected_factory.py,sha256=wK9GG5_d33BdrpimnR6W-zeviZcCS8qe8ZGTmjYtFf4,1135
14
14
  modern_di/providers/list.py,sha256=3hx34RfBRmqzh-cT5D6wSTDJPkBGMK_ul4n9gQz-o9M,769
15
15
  modern_di/providers/resource.py,sha256=UwIrX63Crf5iUXu3cp80hw7orl9ahy8frstxAf1Y7wc,4098
16
16
  modern_di/providers/selector.py,sha256=RQbHD2-Liw-TGqu6UELbfCzXYuqxiO_Mg1tLyF3mKQo,1419
17
17
  modern_di/providers/singleton.py,sha256=7XBNhVzhV5Rh_F7iWZx8is7i7_PuctQ9thKeqIkjnTs,1999
18
- modern_di-0.7.1.dist-info/METADATA,sha256=08xs8ieFrwY7F9eXeMRua_XE_AxMHiSHAxWTepQuD7Y,5440
19
- modern_di-0.7.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
20
- modern_di-0.7.1.dist-info/RECORD,,
18
+ modern_di-0.7.2.dist-info/METADATA,sha256=bmefLrcGPc-baBH_mToSar0qh2m3zEJBPM3_gkOafC8,5440
19
+ modern_di-0.7.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
20
+ modern_di-0.7.2.dist-info/RECORD,,