@@ -367,7 +367,7 @@ def __index__(self) -> int:
367367
368368
369369@prettify_docstrings
370- class UserFloat (Real , SupportsRound ):
370+ class UserFloat (Real ):
371371 """
372372 Class that simulates a float.
373373
@@ -450,37 +450,37 @@ def __round__(self, ndigits: Optional[int] = None) -> Union[int, float]: # type
450450 return float (self ).__round__ (ndigits )
451451
452452 def __eq__ (self , other : object ) -> bool :
453- if isinstance (other , UserFloat ):
453+ if isinstance (other , UserFloat ) and not isinstance ( other , float ) :
454454 return self ._value == other ._value
455455 else :
456456 return float (self ).__eq__ (other )
457457
458458 def __ne__ (self , other : object ) -> bool :
459- if isinstance (other , UserFloat ):
459+ if isinstance (other , UserFloat ) and not isinstance ( other , float ) :
460460 return self ._value != other ._value
461461 else :
462462 return float (self ).__ne__ (other )
463463
464464 def __lt__ (self , other : Union [float , "UserFloat" ]) -> bool :
465- if isinstance (other , UserFloat ):
465+ if isinstance (other , UserFloat ) and not isinstance ( other , float ) :
466466 return self ._value < other ._value
467467 else :
468468 return float (self ).__lt__ (other )
469469
470470 def __le__ (self , other : Union [float , "UserFloat" ]) -> bool :
471- if isinstance (other , UserFloat ):
471+ if isinstance (other , UserFloat ) and not isinstance ( other , float ) :
472472 return self ._value <= other ._value
473473 else :
474474 return float (self ).__le__ (other )
475475
476476 def __gt__ (self , other : Union [float , "UserFloat" ]) -> bool :
477- if isinstance (other , UserFloat ):
477+ if isinstance (other , UserFloat ) and not isinstance ( other , float ) :
478478 return self ._value > other ._value
479479 else :
480480 return float (self ).__gt__ (other )
481481
482482 def __ge__ (self , other : Union [float , "UserFloat" ]) -> bool :
483- if isinstance (other , UserFloat ):
483+ if isinstance (other , UserFloat ) and not isinstance ( other , float ) :
484484 return self ._value >= other ._value
485485 else :
486486 return float (self ).__ge__ (other )
0 commit comments