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 8f45c69 commit 175e053Copy full SHA for 175e053
stdlib/@tests/test_cases/check_operator.py
@@ -0,0 +1,11 @@
1
+from operator import methodcaller
2
+from typing import Any
3
+from typing_extensions import assert_type
4
+
5
+m1 = methodcaller("foo")
6
+assert_type(m1, methodcaller[[], Any])
7
+m2 = methodcaller("foo", 42, bar="")
8
+# assert_type(m2, methodcaller[[int, Arg(str, "bar")], Any])
9
+m3: methodcaller[[], int] = methodcaller("foo") # ok
10
+m4: methodcaller[[int], Any] = methodcaller("foo", 1) # ok
11
+m5: methodcaller[[str], int] = methodcaller("foo", 1) # type: ignore
0 commit comments