Skip to content

Commit 175e053

Browse files
committed
Add tests
1 parent 8f45c69 commit 175e053

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)