-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
false-positivemypy gave an error on correct codemypy gave an error on correct codeneeds discussionpriority-0-hightopic-overloads
Description
I am trying to implement currying in python, it passes Pycharm type checks (which is not as comprehensive as mypy), but my py gives me tons of error like this:
pythonz\basic.py:54: error: Overloaded function signatures 1 and 2 overlap with incompatible return types
Here is a sample of my code
@overload
def curry(f: Callable[[A1], R]) -> PZFunc[A1, R]:
"""curry a function with 1 parameter"""
...
@overload
def curry(f: Callable[[A1, A2], R]) -> PZFunc[A1, PZFunc[A2, R]]:
"""curry a function with 2 parameters"""
...
def curry(f: Callable) -> PZFunc:
"""To curry a function, only support less than 7 parameters
:param f: the normal un-curried python function
:return: A curried PythonZ function
"""
return PZFunc(lambda x: curry(lambda *args: f(x, *args)))schneiderfelipe
Metadata
Metadata
Assignees
Labels
false-positivemypy gave an error on correct codemypy gave an error on correct codeneeds discussionpriority-0-hightopic-overloads