(
self,
hour: SupportsIndex | None = None,
minute: SupportsIndex | None = None,
second: SupportsIndex | None = None,
microsecond: SupportsIndex | None = None,
tzinfo: bool | datetime.tzinfo | Literal[True] | None = True,
fold: int = 0,
)
| 263 | # Compatibility methods |
| 264 | |
| 265 | def replace( |
| 266 | self, |
| 267 | hour: SupportsIndex | None = None, |
| 268 | minute: SupportsIndex | None = None, |
| 269 | second: SupportsIndex | None = None, |
| 270 | microsecond: SupportsIndex | None = None, |
| 271 | tzinfo: bool | datetime.tzinfo | Literal[True] | None = True, |
| 272 | fold: int = 0, |
| 273 | ) -> Self: |
| 274 | if tzinfo is True: |
| 275 | tzinfo = self.tzinfo |
| 276 | |
| 277 | hour = hour if hour is not None else self.hour |
| 278 | minute = minute if minute is not None else self.minute |
| 279 | second = second if second is not None else self.second |
| 280 | microsecond = microsecond if microsecond is not None else self.microsecond |
| 281 | |
| 282 | t = super().replace( |
| 283 | hour, |
| 284 | minute, |
| 285 | second, |
| 286 | microsecond, |
| 287 | tzinfo=cast("Optional[datetime.tzinfo]", tzinfo), |
| 288 | fold=fold, |
| 289 | ) |
| 290 | return self.__class__( |
| 291 | t.hour, t.minute, t.second, t.microsecond, tzinfo=t.tzinfo |
| 292 | ) |
| 293 | |
| 294 | def __getnewargs__(self) -> tuple[Time]: |
| 295 | return (self,) |
no outgoing calls