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

Method __add__

Lib/_pydatetime.py:1212–1219  ·  view source on GitHub ↗

Add a date to a timedelta.

(self, other)

Source from the content-addressed store, hash-verified

1210 # Computations
1211
1212 def __add__(self, other):
1213 "Add a date to a timedelta."
1214 if isinstance(other, timedelta):
1215 o = self.toordinal() + other.days
1216 if 0 < o <= _MAXORDINAL:
1217 return type(self).fromordinal(o)
1218 raise OverflowError("result out of range")
1219 return NotImplemented
1220
1221 __radd__ = __add__
1222

Callers

nothing calls this directly

Calls 3

toordinalMethod · 0.95
isinstanceFunction · 0.85
fromordinalMethod · 0.80

Tested by

no test coverage detected