Subsequent `partial` functions in a list are not type-checked
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.6k
- Forks
- 1.8k
- Avg merge
- 12h 13m
- Merged PRs (30d)
- 52
Description
**Describe the bug**
Only the first `partial` function provided to a `Sequence[Callable[...]]` is type-checked. The subsequent ones are not.
**Code or Screenshots**
```python
from collections.abc import Callable, Sequence
from functools import partial
from typing import Any
def foo(a: int, b: str): ...
def compose(funcs: Sequence[Callable[[str], Any]]): ...
compose(
[
partial(foo, 2),
# This has the wrong signature (Callable[[int, str], Any]),
# but Pyright does not pick it up
partial(foo),
]
)
```
**VS Code extension or command-line**
Are you running pyright as a VS Code extension, a language server in another editor, integrated into Pylance, or the command-line tool? Which version?
This happens in both the VS Code extension and the CLI.
```sh
❯ uv run pyright --version
pyright 1.1.406
```
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
Start by running the supplied Python reproducer with Pyright 1.1.406 in the CLI and compare diagnostics for both partial calls. Done means the second partial(foo) is reported as incompatible with Callable[[str, Any]] in the CLI and VS Code extension.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100