File tree 8 files changed +8
-8
lines changed
8 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ class Provider(Generic[T]):
69
69
@property
70
70
def provider (self ) -> Provider : ...
71
71
@property
72
- def provided (self ) -> ProvidedInstance : ...
72
+ def provided (self ) -> ProvidedInstance [ T ] : ...
73
73
def enable_async_mode (self ) -> None : ...
74
74
def disable_async_mode (self ) -> None : ...
75
75
def reset_async_mode (self ) -> None : ...
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def create(cls) -> Animal:
34
34
35
35
# Test 5: to check the provided instance interface
36
36
provider5 = providers .Callable (Animal )
37
- provided5 : providers . ProvidedInstance = provider5 .provided
37
+ provided5 : Animal = provider5 .provided ()
38
38
attr_getter5 : providers .AttributeGetter = provider5 .provided .attr
39
39
item_getter5 : providers .ItemGetter = provider5 .provided ["item" ]
40
40
method_caller : providers .MethodCaller = provider5 .provided .method .call (123 , arg = 324 )
Original file line number Diff line number Diff line change 34
34
a1 = providers .Factory (object ),
35
35
a2 = providers .Factory (object ),
36
36
)
37
- provided5 : providers . ProvidedInstance = provider5 .provided
37
+ provided5 : dict [ Any , Any ] = provider5 .provided ()
38
38
39
39
40
40
# Test 6: to check the return type with await
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def create(cls) -> Animal:
37
37
38
38
# Test 5: to check the provided instance interface
39
39
provider5 = providers .Factory (Animal )
40
- provided5 : providers . ProvidedInstance = provider5 .provided
40
+ provided5 : Animal = provider5 .provided ()
41
41
attr_getter5 : providers .AttributeGetter = provider5 .provided .attr
42
42
item_getter5 : providers .ItemGetter = provider5 .provided ["item" ]
43
43
method_caller5 : providers .MethodCaller = provider5 .provided .method .call (123 , arg = 324 )
Original file line number Diff line number Diff line change 23
23
providers .Factory (object ),
24
24
providers .Factory (object ),
25
25
)
26
- provided3 : providers . ProvidedInstance = provider3 .provided
26
+ provided3 : List [ Any ] = provider3 .provided ()
27
27
attr_getter3 : providers .AttributeGetter = provider3 .provided .attr
28
28
item_getter3 : providers .ItemGetter = provider3 .provided ["item" ]
29
29
method_caller3 : providers .MethodCaller = provider3 .provided .method .call (123 , arg = 324 )
Original file line number Diff line number Diff line change 9
9
10
10
# Test 2: to check the provided instance interface
11
11
provider2 = providers .Object (int )
12
- provided2 : providers . ProvidedInstance = provider2 .provided
12
+ provided2 : Type [ int ] = provider2 .provided ()
13
13
attr_getter2 : providers .AttributeGetter = provider2 .provided .attr
14
14
item_getter2 : providers .ItemGetter = provider2 .provided ["item" ]
15
15
method_caller2 : providers .MethodCaller = provider2 .provided .method .call (123 , arg = 324 )
Original file line number Diff line number Diff line change 3
3
4
4
# Test 1: to check .provided attribute
5
5
provider1 : providers .Provider [int ] = providers .Object (1 )
6
- provided : providers . ProvidedInstance = provider1 .provided
6
+ provided : int = provider1 .provided ()
7
7
8
8
# Test 2: to check async mode API
9
9
provider2 : providers .Provider = providers .Provider ()
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def create(cls) -> Animal:
37
37
38
38
# Test 5: to check the provided instance interface
39
39
provider5 = providers .Singleton (Animal )
40
- provided5 : providers . ProvidedInstance = provider5 .provided
40
+ provided5 : Animal = provider5 .provided ()
41
41
attr_getter5 : providers .AttributeGetter = provider5 .provided .attr
42
42
item_getter5 : providers .ItemGetter = provider5 .provided ["item" ]
43
43
method_caller5 : providers .MethodCaller = provider5 .provided .method .call (123 , arg = 324 )
You can’t perform that action at this time.
0 commit comments