mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Remove compatibility aliases (#5464)
* Remove compatibility aliases Remove a few instances of Text Use aliases from _typeshed * Remove unused imports
This commit is contained in:
@@ -4,7 +4,6 @@ from typing import ClassVar, NamedTuple, Optional, SupportsAbs, Tuple, Type, Typ
|
||||
|
||||
_S = TypeVar("_S")
|
||||
|
||||
_Text = str
|
||||
MINYEAR: int
|
||||
MAXYEAR: int
|
||||
|
||||
@@ -14,6 +13,9 @@ class tzinfo:
|
||||
def dst(self, dt: Optional[datetime]) -> Optional[timedelta]: ...
|
||||
def fromutc(self, dt: datetime) -> datetime: ...
|
||||
|
||||
# Alias required to avoid name conflicts with date(time).tzinfo.
|
||||
_tzinfo = tzinfo
|
||||
|
||||
class timezone(tzinfo):
|
||||
utc: ClassVar[timezone]
|
||||
min: ClassVar[timezone]
|
||||
@@ -27,8 +29,6 @@ if sys.version_info >= (3, 9):
|
||||
week: int
|
||||
weekday: int
|
||||
|
||||
_tzinfo = tzinfo
|
||||
|
||||
class date:
|
||||
min: ClassVar[date]
|
||||
max: ClassVar[date]
|
||||
@@ -53,7 +53,7 @@ class date:
|
||||
@property
|
||||
def day(self) -> int: ...
|
||||
def ctime(self) -> str: ...
|
||||
def strftime(self, fmt: _Text) -> str: ...
|
||||
def strftime(self, fmt: str) -> str: ...
|
||||
def __format__(self, fmt: str) -> str: ...
|
||||
def isoformat(self) -> str: ...
|
||||
def timetuple(self) -> struct_time: ...
|
||||
@@ -116,7 +116,7 @@ class time:
|
||||
if sys.version_info >= (3, 7):
|
||||
@classmethod
|
||||
def fromisoformat(cls: Type[_S], time_string: str) -> _S: ...
|
||||
def strftime(self, fmt: _Text) -> str: ...
|
||||
def strftime(self, fmt: str) -> str: ...
|
||||
def __format__(self, fmt: str) -> str: ...
|
||||
def utcoffset(self) -> Optional[timedelta]: ...
|
||||
def tzname(self) -> Optional[str]: ...
|
||||
@@ -243,7 +243,7 @@ class datetime(date):
|
||||
if sys.version_info >= (3, 7):
|
||||
@classmethod
|
||||
def fromisoformat(cls: Type[_S], date_string: str) -> _S: ...
|
||||
def strftime(self, fmt: _Text) -> str: ...
|
||||
def strftime(self, fmt: str) -> str: ...
|
||||
def __format__(self, fmt: str) -> str: ...
|
||||
def toordinal(self) -> int: ...
|
||||
def timetuple(self) -> struct_time: ...
|
||||
@@ -272,7 +272,7 @@ class datetime(date):
|
||||
def ctime(self) -> str: ...
|
||||
def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...
|
||||
@classmethod
|
||||
def strptime(cls, date_string: _Text, format: _Text) -> datetime: ...
|
||||
def strptime(cls, date_string: str, format: str) -> datetime: ...
|
||||
def utcoffset(self) -> Optional[timedelta]: ...
|
||||
def tzname(self) -> Optional[str]: ...
|
||||
def dst(self) -> Optional[timedelta]: ...
|
||||
|
||||
Reference in New Issue
Block a user