Skip to content

Commit f0094d1

Browse files
committed
testing typing using mypy
1 parent bd96b66 commit f0094d1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

example.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@ def my_max(*args: int) -> int:
8282
# TODO Callable from typing , means what we can do execute , i.e. functions named anonymous and classes with __call_
8383

8484
Z = TypeVar('Z')
85+
X = TypeVar('X')
8586

86-
def sentence(cb: Callable[[Z], Z], txt: Z) -> Z:
87+
def sentence(cb: Callable[[Z], X], txt: Z) -> X:
8788
return cb(txt)
8889

89-
sentence (lambda x: x.upper(), 'ala ma kota')
90+
sentence (lambda x: x.upper(), 'ala ma kota')
91+
sentence (lambda x: str(x).upper(), '42')
92+
sentence (lambda x: str(x).upper(), 42)

0 commit comments

Comments
 (0)