Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 143
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
What's wrong
When using returns.curry.partial, if you partially apply a positional parameter using a keyword argument, the resulting type is incorrect. Result type of callable allows passing the remaining arguments as positional, but this leads to a runtime error.
Example
deffoo(x: int, y: int) ->None: ... bar=returns.curry.partial(foo, x=1) reveal_type(bar) # => Mypy: "def (y: builtins.int)"# => Expected: "def (*, y: builtins.int)"bar(2) # No errors from mypy, but got runtime error# TypeError: foo() got multiple values for argument 'x'How is that should be
In this scenario, the remaining parameters should be strictly keyword-only. The resulting type should reflect this restriction, and passing a positional argument should be flagged as an error at type checking time.
System information
pythonversion:3.13.4returnsversion:0.25.0mypyversion:1.15.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working