-
-
Save arian-f/17119110e26eba7bf5512ced51503304 to your computer and use it in GitHub Desktop.
possible dupe of https://github.com/python/mypy/issues/9527
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def double(x: int) -> int: | |
return x * 2 | |
def add(x: int, y: int) -> int: | |
return x + y | |
def doubleAndAdd(x: int, y: int) -> None: | |
steps = ( | |
(double, (x,)), | |
(add, (x, y)), | |
) | |
for func, args in steps: | |
func(*args) # error: Cannot call function of unknown type | |
def doubleTwice(x: int, y: int) -> None: | |
steps = ( | |
(double, (x, )), | |
(double, (y, )), | |
) | |
for func, args in steps: | |
func(*args) # passes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment