Use __new__ for datetime.timedelta (#5532)

This commit is contained in:
scaramallion authored and GitHub committed 2021-05-26 11:05:26 +02:00
1 parent a32d24cae0
commit af33b09bf6
2 files changed
+6 -8

No files matched your search

+3 -5
View File
@@ -139,8 +139,8 @@ class timedelta(SupportsAbs[timedelta]):
min: ClassVar[timedelta]
max: ClassVar[timedelta]
resolution: ClassVar[timedelta]
def __init__(
self,
def __new__(
cls: Type[_S],
days: float = ...,
seconds: float = ...,
microseconds: float = ...,
@@ -148,9 +148,7 @@ class timedelta(SupportsAbs[timedelta]):
minutes: float = ...,
hours: float = ...,
weeks: float = ...,
*,
fold: int = ...,
) -> None: ...
) -> _S: ...
@property
def days(self) -> int: ...
@property