mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Add type hint for fold arguments to datetime.datetime and datetime.time when Python >= 3.6 (#2449)
`datetime.datetime()` and `datetime.time()` have started to support fold arguments from 3.6. - https://www.python.org/dev/peps/pep-0495/ - https://docs.python.org/3.5/library/datetime.html#datetime.datetime - https://docs.python.org/3.6/library/datetime.html#datetime.datetime - https://docs.python.org/3.5/library/datetime.html#datetime.time - https://docs.python.org/3.6/library/datetime.html#datetime.time
This commit is contained in:
@@ -83,8 +83,12 @@ class time:
|
||||
max: ClassVar[time]
|
||||
resolution: ClassVar[timedelta]
|
||||
|
||||
def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ...,
|
||||
tzinfo: Optional[_tzinfo] = ...) -> None: ...
|
||||
if sys.version_info >= (3, 6):
|
||||
def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ...,
|
||||
tzinfo: Optional[_tzinfo] = ..., *, fold: int = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ...,
|
||||
tzinfo: Optional[_tzinfo] = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def hour(self) -> int: ...
|
||||
@@ -133,9 +137,14 @@ class timedelta(SupportsAbs[timedelta]):
|
||||
max: ClassVar[timedelta]
|
||||
resolution: ClassVar[timedelta]
|
||||
|
||||
def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ...,
|
||||
milliseconds: float = ..., minutes: float = ..., hours: float = ...,
|
||||
weeks: float = ...) -> None: ...
|
||||
if sys.version_info >= (3, 6):
|
||||
def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ...,
|
||||
milliseconds: float = ..., minutes: float = ..., hours: float = ...,
|
||||
weeks: float = ..., *, fold: int = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, days: float = ..., seconds: float = ..., microseconds: float = ...,
|
||||
milliseconds: float = ..., minutes: float = ..., hours: float = ...,
|
||||
weeks: float = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def days(self) -> int: ...
|
||||
|
||||
Reference in New Issue
Block a user