You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix --strict-equality crash for instances of a class generic over a ParamSpec (#14792)
Fixes#14783.
Running mypy on this snippet of code currently causes a crash if you
have the `--strict-equality` option enabled:
```python
from typing import Generic, ParamSpec
P = ParamSpec("P")
class Foo(Generic[P]): ...
def checker(foo1: Foo[[int]], foo2: Foo[[str]]) -> None:
foo1 == foo2
```
This is because the overlapping-equality logic in `meet.py` currently
does not account for the fact that `left` and `right` might both be
instances of `mypy.types.Parameters`, leading to this assertion being
tripped:
https://github.com/python/mypy/blob/800e8ffdf17de9fc641fefff46389a940f147eef/mypy/meet.py#L519
This PR attempts to add the necessary logic to `meet.py` to handle
instances of `mypy.types.Parameters`.
0 commit comments