mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 22:56:55 +08:00
Add several Python 3.8 annotations (#3347)
This commit is contained in:
@@ -37,14 +37,17 @@ class date:
|
||||
def __init__(self, year: int, month: int, day: int) -> None: ...
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t: float) -> date: ...
|
||||
def fromtimestamp(cls: Type[_S], t: float) -> _S: ...
|
||||
@classmethod
|
||||
def today(cls) -> date: ...
|
||||
def today(cls: Type[_S]) -> _S: ...
|
||||
@classmethod
|
||||
def fromordinal(cls, n: int) -> date: ...
|
||||
def fromordinal(cls: Type[_S], n: int) -> _S: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@classmethod
|
||||
def fromisoformat(cls, date_string: str) -> date: ...
|
||||
def fromisoformat(cls: Type[_S], date_string: str) -> _S: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@classmethod
|
||||
def fromisocalendar(cls: Type[_S], year: int, week: int, day: int) -> _S: ...
|
||||
|
||||
@property
|
||||
def year(self) -> int: ...
|
||||
@@ -114,7 +117,7 @@ class time:
|
||||
def isoformat(self) -> str: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@classmethod
|
||||
def fromisoformat(cls, time_string: str) -> time: ...
|
||||
def fromisoformat(cls: Type[_S], time_string: str) -> _S: ...
|
||||
def strftime(self, fmt: _Text) -> str: ...
|
||||
if sys.version_info >= (3,):
|
||||
def __format__(self, fmt: str) -> str: ...
|
||||
@@ -222,13 +225,13 @@ class datetime(date):
|
||||
def fold(self) -> int: ...
|
||||
|
||||
@classmethod
|
||||
def fromtimestamp(cls, t: float, tz: Optional[_tzinfo] = ...) -> datetime: ...
|
||||
def fromtimestamp(cls: Type[_S], t: float, tz: Optional[_tzinfo] = ...) -> _S: ...
|
||||
@classmethod
|
||||
def utcfromtimestamp(cls, t: float) -> datetime: ...
|
||||
def utcfromtimestamp(cls: Type[_S], t: float) -> _S: ...
|
||||
@classmethod
|
||||
def today(cls) -> datetime: ...
|
||||
def today(cls: Type[_S]) -> _S: ...
|
||||
@classmethod
|
||||
def fromordinal(cls, n: int) -> datetime: ...
|
||||
def fromordinal(cls: Type[_S], n: int) -> _S: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@classmethod
|
||||
def now(cls: Type[_S], tz: Optional[_tzinfo] = ...) -> _S: ...
|
||||
@@ -240,7 +243,7 @@ class datetime(date):
|
||||
@classmethod
|
||||
def now(cls, tz: _tzinfo) -> datetime: ...
|
||||
@classmethod
|
||||
def utcnow(cls) -> datetime: ...
|
||||
def utcnow(cls: Type[_S]) -> _S: ...
|
||||
if sys.version_info >= (3, 6):
|
||||
@classmethod
|
||||
def combine(cls, date: _date, time: _time, tzinfo: Optional[_tzinfo] = ...) -> datetime: ...
|
||||
@@ -249,7 +252,7 @@ class datetime(date):
|
||||
def combine(cls, date: _date, time: _time) -> datetime: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
@classmethod
|
||||
def fromisoformat(cls, date_string: str) -> datetime: ...
|
||||
def fromisoformat(cls: Type[_S], date_string: str) -> _S: ...
|
||||
def strftime(self, fmt: _Text) -> str: ...
|
||||
if sys.version_info >= (3,):
|
||||
def __format__(self, fmt: str) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user