MCPcopy Index your code
hub / github.com/RustPython/RustPython / __sub__

Method __sub__

Lib/_pydecimal.py:1196–1208  ·  view source on GitHub ↗

Return self - other

(self, other, context=None)

Source from the content-addressed store, hash-verified

1194 __radd__ = __add__
1195
1196 def __sub__(self, other, context=None):
1197 """Return self - other"""
1198 other = _convert_other(other)
1199 if other is NotImplemented:
1200 return other
1201
1202 if self._is_special or other._is_special:
1203 ans = self._check_nans(other, context=context)
1204 if ans:
1205 return ans
1206
1207 # self - other is computed as self + other.copy_negate()
1208 return self.__add__(other.copy_negate(), context=context)
1209
1210 def __rsub__(self, other, context=None):
1211 """Return other - self"""

Callers 3

next_minusMethod · 0.95
__rsub__Method · 0.45
subtractMethod · 0.45

Calls 4

_check_nansMethod · 0.95
__add__Method · 0.95
_convert_otherFunction · 0.85
copy_negateMethod · 0.45

Tested by

no test coverage detected