Use __new__ for datetime.time (#5530)

This commit is contained in:
scaramallion
2021-05-26 18:00:37 +10:00
committed by GitHub
parent 9b2f158fdb
commit a32d24cae0
3 changed files with 15 additions and 10 deletions

View File

@@ -59,9 +59,14 @@ class time:
min: ClassVar[time]
max: ClassVar[time]
resolution: ClassVar[timedelta]
def __init__(
self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo: Optional[_tzinfo] = ...
) -> None: ...
def __new__(
cls: Type[_S],
hour: int = ...,
minute: int = ...,
second: int = ...,
microsecond: int = ...,
tzinfo: Optional[_tzinfo] = ...,
) -> _S: ...
@property
def hour(self) -> int: ...
@property