microsoft / pyright

Static Type Checker for Python
Other
13.04k stars 1.39k forks source link

Fixed a bug that results in false positive `reportInconsistentConstru… #8383

Closed erictraut closed 1 month ago

erictraut commented 1 month ago

…ctorerrors if one or both ofinitornew` are overloaded. This addresses #8372.

github-actions[bot] commented 1 month ago

Diff from mypy_primer, showing the effect of this PR on open source code:

trio (https://github.com/python-trio/trio)
-     Signature of __init__ is "(self: RaisesGroup, exception: type[E@__init__] | Matcher[E@__init__] | E@__init__, ..., allow_unwrapped: bool = False, flatten_subgroups: bool = False, match: str | Pattern[str] | None = None, check: ((Unknown) -> bool) | None = None, strict: None = None)"
+     Signature of __init__ is "(exception: type[E@__init__] | Matcher[E@__init__] | E@__init__, ..., allow_unwrapped: bool = False, flatten_subgroups: bool = False, match: str | Pattern[str] | None = None, check: ((Unknown) -> bool) | None = None, strict: None = None)"