We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68e86a2 commit af98c97Copy full SHA for af98c97
tests/typing/selector.py
@@ -40,3 +40,14 @@
40
async def _async4() -> None:
41
var1: Any = await provider4()
42
var2: Any = await provider4.async_()
43
+
44
45
+# Test 5: to check explicit typing
46
47
+provider5 = providers.Selector[bool](lambda: "a", a=providers.Factory(bool), b=providers.Factory(int))
48
+var5: bool = provider5()
49
+attr5: providers.Provider[Any] = provider5.a
50
+provider5_after_set_selector: providers.Selector[bool] = provider5.set_selector(lambda: "a")
51
+provider5_after_set_providers: providers.Selector[Any] = provider5.set_providers(
52
+ c=providers.Factory(str)
53
+) # Selector[Any] for now since Provider is invariant
0 commit comments