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 bd96b66 commit f0094d1Copy full SHA for f0094d1
example.py
@@ -82,8 +82,11 @@ def my_max(*args: int) -> int:
82
# TODO Callable from typing , means what we can do execute , i.e. functions named anonymous and classes with __call_
83
84
Z = TypeVar('Z')
85
+X = TypeVar('X')
86
-def sentence(cb: Callable[[Z], Z], txt: Z) -> Z:
87
+def sentence(cb: Callable[[Z], X], txt: Z) -> X:
88
return cb(txt)
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