MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __add__

Method __add__

tools/python-3.11.9-amd64/Lib/datetime.py:1139–1146  ·  view source on GitHub ↗

Add a date to a timedelta.

(self, other)

Source from the content-addressed store, hash-verified

1137 # Computations
1138
1139 def __add__(self, other):
1140 "Add a date to a timedelta."
1141 if isinstance(other, timedelta):
1142 o = self.toordinal() + other.days
1143 if 0 < o <= _MAXORDINAL:
1144 return type(self).fromordinal(o)
1145 raise OverflowError("result out of range")
1146 return NotImplemented
1147
1148 __radd__ = __add__
1149

Callers

nothing calls this directly

Calls 3

toordinalMethod · 0.95
fromordinalMethod · 0.80
typeClass · 0.50

Tested by

no test coverage detected