(🐞) False positive error for list of two callables
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
This list is perfectly valid. only usages should be an error.
def f1(*, a: int): ...
def f2(*, b: int): ...
[f1, f2] # error: List item 0 has incompatible type "(NamedArg(int, 'a')) -> None]"; expected "(NamedArg(int, 'b')) -> None"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the linked mypy-play reproduction first, then trace the callable-type inference responsible for the list-item error. Done means the two callable definitions can appear together in a list without an error, while invalid usages still produce errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100