mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
Mark use of tzinfo optional in the datetime module. (#637)
This commit is contained in:
committed by
Guido van Rossum
parent
15ec66cdd6
commit
b1c545cee6
@@ -74,7 +74,7 @@ class time:
|
||||
resolution = ... # type: timedelta
|
||||
|
||||
def __init__(self, hour: int = ..., minute: int = ..., second: int = ..., microsecond: int = ...,
|
||||
tzinfo: tzinfo = ...) -> None: ...
|
||||
tzinfo: Optional[tzinfo] = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def hour(self) -> int: ...
|
||||
@@ -85,7 +85,7 @@ class time:
|
||||
@property
|
||||
def microsecond(self) -> int: ...
|
||||
@property
|
||||
def tzinfo(self) -> _tzinfo: ...
|
||||
def tzinfo(self) -> Optional[_tzinfo]: ...
|
||||
|
||||
def __le__(self, other: time) -> bool: ...
|
||||
def __lt__(self, other: time) -> bool: ...
|
||||
@@ -99,7 +99,7 @@ class time:
|
||||
def tzname(self) -> Optional[str]: ...
|
||||
def dst(self) -> Optional[int]: ...
|
||||
def replace(self, hour: int = ..., minute: int = ..., second: int = ...,
|
||||
microsecond: int = ..., tzinfo: _tzinfo = None) -> time: ...
|
||||
microsecond: int = ..., tzinfo: Optional[_tzinfo] = None) -> time: ...
|
||||
|
||||
_date = date
|
||||
_time = time
|
||||
@@ -155,7 +155,7 @@ class datetime:
|
||||
|
||||
def __init__(self, year: int, month: int = ..., day: int = ..., hour: int = ...,
|
||||
minute: int = ..., second: int = ..., microsecond: int = ...,
|
||||
tzinfo: tzinfo = ...) -> None: ...
|
||||
tzinfo: Optional[tzinfo] = ...) -> None: ...
|
||||
|
||||
@property
|
||||
def year(self) -> int: ...
|
||||
@@ -172,10 +172,10 @@ class datetime:
|
||||
@property
|
||||
def microsecond(self) -> int: ...
|
||||
@property
|
||||
def tzinfo(self) -> _tzinfo: ...
|
||||
def tzinfo(self) -> Optional[_tzinfo]: ...
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t: float, tz: timezone = ...) -> datetime: ...
|
||||
def fromtimestamp(cls, t: float, tz: Optional[timezone] = ...) -> datetime: ...
|
||||
@classmethod
|
||||
def utcfromtimestamp(cls, t: float) -> datetime: ...
|
||||
@classmethod
|
||||
@@ -183,7 +183,7 @@ class datetime:
|
||||
@classmethod
|
||||
def fromordinal(cls, n: int) -> datetime: ...
|
||||
@classmethod
|
||||
def now(cls, tz: _tzinfo = ...) -> datetime: ...
|
||||
def now(cls, tz: Optional[_tzinfo] = ...) -> datetime: ...
|
||||
@classmethod
|
||||
def utcnow(cls) -> datetime: ...
|
||||
@classmethod
|
||||
@@ -199,8 +199,8 @@ class datetime:
|
||||
def timetz(self) -> _time: ...
|
||||
def replace(self, year: int = ..., month: int = ..., day: int = ..., hour: int = ...,
|
||||
minute: int = ..., second: int = ..., microsecond: int = ..., tzinfo:
|
||||
_tzinfo = None) -> datetime: ...
|
||||
def astimezone(self, tz: _tzinfo = ...) -> datetime: ...
|
||||
Optional[_tzinfo] = None) -> datetime: ...
|
||||
def astimezone(self, tz: Optional[_tzinfo] = ...) -> datetime: ...
|
||||
def ctime(self) -> str: ...
|
||||
def isoformat(self, sep: str = ...) -> str: ...
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user