This code is not failing under mypy:
Interestingly, it fails on ty:
error[invalid-argument-type]: Argument to bound method `list.sort` is incorrect
--> toto.py:1:1
|
1 | [None, 2].sort()
| ^^^^^^^^^^^^^^^^ Argument type `None | int` does not satisfy upper bound `SupportsDunderLT[Any] | SupportsDunderGT[Any]` of type variable `SupportsRichComparisonT`
|
info: Type variable defined here
--> stdlib/_typeshed/__init__.pyi:107:1
|
107 | SupportsRichComparisonT = TypeVar("SupportsRichComparisonT", bound=SupportsRichComparison) # noqa: Y001
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
Found 1 diagnostic
This code is not failing under mypy:
Interestingly, it fails on ty: