mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-10-18 09:44:29 +03:00
Add missing stub on providers.Resource for AbstractContextManager and AbstractAsyncContextManager
This commit is contained in:
parent
5acddac9c1
commit
29827cb411
|
@ -1,5 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from contextlib import AbstractContextManager, AbstractAsyncContextManager
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import (
|
from typing import (
|
||||||
Awaitable,
|
Awaitable,
|
||||||
|
@ -465,6 +466,20 @@ class Resource(Provider[T]):
|
||||||
**kwargs: Injection,
|
**kwargs: Injection,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
@overload
|
@overload
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
provides: Optional[_Callable[..., AbstractContextManager[T]]] = None,
|
||||||
|
*args: Injection,
|
||||||
|
**kwargs: Injection,
|
||||||
|
) -> None: ...
|
||||||
|
@overload
|
||||||
|
def __init__(
|
||||||
|
self,
|
||||||
|
provides: Optional[_Callable[..., AbstractAsyncContextManager[T]]] = None,
|
||||||
|
*args: Injection,
|
||||||
|
**kwargs: Injection,
|
||||||
|
) -> None: ...
|
||||||
|
@overload
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
provides: Optional[_Callable[..., _Iterator[T]]] = None,
|
provides: Optional[_Callable[..., _Iterator[T]]] = None,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user