report an error when `__init__` and `__new__` signatures are incompatible
Open
typechecking
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 516
- PR merge metrics
- No merged PRs in 30d
Description
basically pyright's `reportInconsistentConstructor` rule:
```py
from typing import Self
class Foo:
def __init__(self) -> None: # error: Mismatch between signature of __new__ and __init__ in class "Foo" (reportInconsistentConstructor)
...
def __new__(cls, value: int) -> Self:
...
```
(note that the pyright rule is a bit too strict however, see https://github.com/DetachHead/basedpyright/issues/1785#issuecomment-4303007748)
Contributor guide
Assessment
This issue has not been assessed yet.