(self)
| 140 | if PYPY: |
| 141 | |
| 142 | def total_seconds(self) -> float: |
| 143 | days = 0 |
| 144 | |
| 145 | if hasattr(self, "_years"): |
| 146 | days += self._years * 365 |
| 147 | |
| 148 | if hasattr(self, "_months"): |
| 149 | days += self._months * 30 |
| 150 | |
| 151 | if hasattr(self, "_remaining_days"): |
| 152 | days += self._weeks * 7 + self._remaining_days |
| 153 | else: |
| 154 | days += self._days |
| 155 | |
| 156 | return ( |
| 157 | (days * SECONDS_PER_DAY + self._seconds) * US_PER_SECOND |
| 158 | + self._microseconds |
| 159 | ) / US_PER_SECOND |
| 160 | |
| 161 | @property |
| 162 | def years(self) -> int: |
no outgoing calls