@@ -367,7 +367,7 @@ def __index__(self) -> int:
367
367
368
368
369
369
@prettify_docstrings
370
- class UserFloat (Real , SupportsRound ):
370
+ class UserFloat (Real ):
371
371
"""
372
372
Class that simulates a float.
373
373
@@ -450,37 +450,37 @@ def __round__(self, ndigits: Optional[int] = None) -> Union[int, float]: # type
450
450
return float (self ).__round__ (ndigits )
451
451
452
452
def __eq__ (self , other : object ) -> bool :
453
- if isinstance (other , UserFloat ):
453
+ if isinstance (other , UserFloat ) and not isinstance ( other , float ) :
454
454
return self ._value == other ._value
455
455
else :
456
456
return float (self ).__eq__ (other )
457
457
458
458
def __ne__ (self , other : object ) -> bool :
459
- if isinstance (other , UserFloat ):
459
+ if isinstance (other , UserFloat ) and not isinstance ( other , float ) :
460
460
return self ._value != other ._value
461
461
else :
462
462
return float (self ).__ne__ (other )
463
463
464
464
def __lt__ (self , other : Union [float , "UserFloat" ]) -> bool :
465
- if isinstance (other , UserFloat ):
465
+ if isinstance (other , UserFloat ) and not isinstance ( other , float ) :
466
466
return self ._value < other ._value
467
467
else :
468
468
return float (self ).__lt__ (other )
469
469
470
470
def __le__ (self , other : Union [float , "UserFloat" ]) -> bool :
471
- if isinstance (other , UserFloat ):
471
+ if isinstance (other , UserFloat ) and not isinstance ( other , float ) :
472
472
return self ._value <= other ._value
473
473
else :
474
474
return float (self ).__le__ (other )
475
475
476
476
def __gt__ (self , other : Union [float , "UserFloat" ]) -> bool :
477
- if isinstance (other , UserFloat ):
477
+ if isinstance (other , UserFloat ) and not isinstance ( other , float ) :
478
478
return self ._value > other ._value
479
479
else :
480
480
return float (self ).__gt__ (other )
481
481
482
482
def __ge__ (self , other : Union [float , "UserFloat" ]) -> bool :
483
- if isinstance (other , UserFloat ):
483
+ if isinstance (other , UserFloat ) and not isinstance ( other , float ) :
484
484
return self ._value >= other ._value
485
485
else :
486
486
return float (self ).__ge__ (other )
0 commit comments