mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 22:56:55 +08:00
Fix datetime stubs (#992)
This commit is contained in:
committed by
Guido van Rossum
parent
0bf23b3727
commit
52da2a176b
@@ -21,7 +21,7 @@ class date(object):
|
||||
max = ... # type: date
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, year: int, month: int = ..., day: int = ...) -> None: ...
|
||||
def __init__(self, year: int, month: int, day: int) -> None: ...
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t: float) -> date: ...
|
||||
@@ -125,11 +125,9 @@ class timedelta(SupportsAbs[timedelta]):
|
||||
@overload
|
||||
def __floordiv__(self, other: int) -> timedelta: ...
|
||||
@overload
|
||||
def __truediv__(self, other: timedelta) -> float: ...
|
||||
def __div__(self, other: timedelta) -> float: ...
|
||||
@overload
|
||||
def __truediv__(self, other: float) -> timedelta: ...
|
||||
def __mod__(self, other: timedelta) -> timedelta: ...
|
||||
def __divmod__(self, other: timedelta) -> Tuple[int, timedelta]: ...
|
||||
def __div__(self, other: float) -> timedelta: ...
|
||||
def __le__(self, other: timedelta) -> bool: ...
|
||||
def __lt__(self, other: timedelta) -> bool: ...
|
||||
def __ge__(self, other: timedelta) -> bool: ...
|
||||
@@ -142,7 +140,7 @@ class datetime(object):
|
||||
max = ... # type: datetime
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, year: int, month: int = ..., day: int = ..., hour: int = ...,
|
||||
def __init__(self, year: int, month: int, day: int, hour: int = ...,
|
||||
minute: int = ..., second: int = ..., microseconds: int = ...,
|
||||
tzinfo: tzinfo = ...) -> None: ...
|
||||
|
||||
@@ -161,7 +159,7 @@ class datetime(object):
|
||||
@property
|
||||
def microsecond(self) -> int: ...
|
||||
@property
|
||||
def tzinfo(self) -> _tzinfo: ...
|
||||
def tzinfo(self) -> Optional[_tzinfo]: ...
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t: float, tz: _tzinfo = ...) -> datetime: ...
|
||||
@@ -181,7 +179,6 @@ class datetime(object):
|
||||
def __format__(self, fmt: str) -> str: ...
|
||||
def toordinal(self) -> int: ...
|
||||
def timetuple(self) -> struct_time: ...
|
||||
def timestamp(self) -> float: ...
|
||||
def utctimetuple(self) -> struct_time: ...
|
||||
def date(self) -> _date: ...
|
||||
def time(self) -> _time: ...
|
||||
@@ -189,7 +186,7 @@ class datetime(object):
|
||||
def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,
|
||||
minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:
|
||||
Union[_tzinfo, bool] = ...) -> datetime: ...
|
||||
def astimezone(self, tz: _tzinfo = ...) -> datetime: ...
|
||||
def astimezone(self, tz: _tzinfo) -> datetime: ...
|
||||
def ctime(self) -> str: ...
|
||||
def isoformat(self, sep: str = ...) -> str: ...
|
||||
@classmethod
|
||||
|
||||
@@ -31,7 +31,7 @@ class date:
|
||||
max = ... # type: date
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, year: int, month: int = ..., day: int = ...) -> None: ...
|
||||
def __init__(self, year: int, month: int, day: int) -> None: ...
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t: float) -> date: ...
|
||||
|
||||
Reference in New Issue
Block a user