Skip to content

Commit 350a69b

Browse files
committed
Add missing stub on providers.Resource for AbstractContextManager and AbstractAsyncContextManager
1 parent 5a1aef9 commit 350a69b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/dependency_injector/providers.pyi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
from contextlib import AbstractContextManager, AbstractAsyncContextManager
34
from pathlib import Path
45
from typing import (
56
Awaitable,
@@ -465,6 +466,20 @@ class Resource(Provider[T]):
465466
**kwargs: Injection,
466467
) -> None: ...
467468
@overload
469+
def __init__(
470+
self,
471+
provides: Optional[_Callable[..., AbstractContextManager[T]]] = None,
472+
*args: Injection,
473+
**kwargs: Injection,
474+
) -> None: ...
475+
@overload
476+
def __init__(
477+
self,
478+
provides: Optional[_Callable[..., AbstractAsyncContextManager[T]]] = None,
479+
*args: Injection,
480+
**kwargs: Injection,
481+
) -> None: ...
482+
@overload
468483
def __init__(
469484
self,
470485
provides: Optional[_Callable[..., _Iterator[T]]] = None,

0 commit comments

Comments
 (0)