fromtypingimportProtocolclassSupportsComparison[CompatT, TruthT](Protocol):
def__gt__(self, other: CompatT, /) ->TruthT: ...
def__ge__(self, other: CompatT, /) ->TruthT: ...
def__lt__(self, other: CompatT, /) ->TruthT: ...
def__le__(self, other: CompatT, /) ->TruthT: ...
classScalar[CompatT, TruthT=Bool]( # ❌️ Cannot resolve name "Bool"SupportsComparison[CompatT, TruthT],
): ...
# Specialized Scalar TypesclassBool(Scalar): ...
classInt(Scalar): ...
classFloat(Scalar): ...
classComplex(Scalar): ...
mypy complains with
py:9:30: error: Cannot resolve name "Bool" (possible cyclic definition) [misc]
py:9:30: error: TypeVar "default" must be a type [misc]
pyright, ty and pyrefly report no errors.
tested with mypy 1.19.1 on python 3.14.2
mypy complains with
pyright, ty and pyrefly report no errors.
tested with mypy 1.19.1 on python 3.14.2