MCPcopy Index your code
hub / github.com/python/cpython / __sub__

Method __sub__

Lib/_pydecimal.py:1199–1211  ·  view source on GitHub ↗

Return self - other

(self, other, context=None)

Source from the content-addressed store, hash-verified

1197 __radd__ = __add__
1198
1199 def __sub__(self, other, context=None):
1200 """Return self - other"""
1201 other = _convert_other(other)
1202 if other is NotImplemented:
1203 return other
1204
1205 if self._is_special or other._is_special:
1206 ans = self._check_nans(other, context=context)
1207 if ans:
1208 return ans
1209
1210 # self - other is computed as self + other.copy_negate()
1211 return self.__add__(other.copy_negate(), context=context)
1212
1213 def __rsub__(self, other, context=None):
1214 """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