microsoft / microsoft/pyright

No reportIncompatibleMethodOverride on base method with *args and **kwargs

Open
#11,092 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
15.6k
Forks
1.8k
Avg merge
12h 13m
Merged PRs (30d)
52

Description

### Discussed in https://github.com/microsoft/pyright/discussions/11091

Originally posted by **rchl** November 4, 2025
Not sure if it's a bug, limitation or on purpose so asking here first.

With a code like:

```py
from typing import Any, override

class Base:
def run(self, foo: str, *args: Any, **kwargs: Any) -> None:
pass

class Impl1(Base):
def run(self, foo: int) -> None:
pass

class Impl2(Base):
def run(self) -> None:
pass

class Impl3(Base):
def run(self, foo: str) -> None:
pass
```

pyright doesn't report `reportIncompatibleMethodOverride` in cases `Impl1` and `Impl2`. `mypy` does report:

```
_test_types.py:11: error: Signature of "run" incompatible with supertype "Base" [override]
_test_types.py:11: note: Superclass:
_test_types.py:11: note: def run(self, foo: str, *args: Any, **kwargs: Any) -> None
_test_types.py:11: note: Subclass:
_test_types.py:11: note: def run(self, foo: int) -> None
_test_types.py:16: error: Signature of "run" incompatible with supertype "Base" [override]
_test_types.py:16: note: Superclass:
_test_types.py:16: note: def run(self, foo: str, *args: Any, **kwargs: Any) -> None
_test_types.py:16: note: Subclass:
_test_types.py:16: note: def run(self) -> None
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided Base, Impl1, Impl2, and Impl3 example and locate Pyright's reportIncompatibleMethodOverride handling and existing method-override tests. Add regression coverage for the incompatible signatures involving *args and **kwargs, then verify that Impl1 and Impl2 produce diagnostics while Impl3 remains valid.

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
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.