Use lowercase type everywhere (#6853)

This commit is contained in:
Alex Waygood
2022-01-08 15:09:29 +00:00
committed by GitHub
parent f8501d33c7
commit a40d79a4e6
172 changed files with 728 additions and 761 deletions

View File

@@ -1,6 +1,6 @@
import sys
from time import struct_time
from typing import ClassVar, NamedTuple, NoReturn, SupportsAbs, Type, TypeVar, overload
from typing import ClassVar, NamedTuple, NoReturn, SupportsAbs, TypeVar, overload
from typing_extensions import final
_S = TypeVar("_S")
@@ -36,19 +36,19 @@ class date:
min: ClassVar[date]
max: ClassVar[date]
resolution: ClassVar[timedelta]
def __new__(cls: Type[_S], year: int, month: int, day: int) -> _S: ...
def __new__(cls: type[_S], year: int, month: int, day: int) -> _S: ...
@classmethod
def fromtimestamp(cls: Type[_S], __timestamp: float) -> _S: ...
def fromtimestamp(cls: type[_S], __timestamp: float) -> _S: ...
@classmethod
def today(cls: Type[_S]) -> _S: ...
def today(cls: type[_S]) -> _S: ...
@classmethod
def fromordinal(cls: Type[_S], __n: int) -> _S: ...
def fromordinal(cls: type[_S], __n: int) -> _S: ...
if sys.version_info >= (3, 7):
@classmethod
def fromisoformat(cls: Type[_S], __date_string: str) -> _S: ...
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: ...
def fromisocalendar(cls: type[_S], year: int, week: int, day: int) -> _S: ...
@property
def year(self) -> int: ...
@property
@@ -98,7 +98,7 @@ class time:
max: ClassVar[time]
resolution: ClassVar[timedelta]
def __new__(
cls: Type[_S],
cls: type[_S],
hour: int = ...,
minute: int = ...,
second: int = ...,
@@ -127,7 +127,7 @@ class time:
def isoformat(self, timespec: str = ...) -> str: ...
if sys.version_info >= (3, 7):
@classmethod
def fromisoformat(cls: Type[_S], __time_string: str) -> _S: ...
def fromisoformat(cls: type[_S], __time_string: str) -> _S: ...
def strftime(self, __format: str) -> str: ...
def __format__(self, __fmt: str) -> str: ...
def utcoffset(self) -> timedelta | None: ...
@@ -152,7 +152,7 @@ class timedelta(SupportsAbs[timedelta]):
max: ClassVar[timedelta]
resolution: ClassVar[timedelta]
def __new__(
cls: Type[_S],
cls: type[_S],
days: float = ...,
seconds: float = ...,
microseconds: float = ...,
@@ -199,7 +199,7 @@ class datetime(date):
max: ClassVar[datetime]
resolution: ClassVar[timedelta]
def __new__(
cls: Type[_S],
cls: type[_S],
year: int,
month: int,
day: int,
@@ -227,26 +227,26 @@ class datetime(date):
# but it is named "timestamp" in the C implementation and "t" in the Python implementation,
# so it is only truly *safe* to pass it as a positional argument.
@classmethod
def fromtimestamp(cls: Type[_S], __timestamp: float, tz: _tzinfo | None = ...) -> _S: ...
def fromtimestamp(cls: type[_S], __timestamp: float, tz: _tzinfo | None = ...) -> _S: ...
@classmethod
def utcfromtimestamp(cls: Type[_S], __t: float) -> _S: ...
def utcfromtimestamp(cls: type[_S], __t: float) -> _S: ...
if sys.version_info >= (3, 8):
@classmethod
def now(cls: Type[_S], tz: _tzinfo | None = ...) -> _S: ...
def now(cls: type[_S], tz: _tzinfo | None = ...) -> _S: ...
else:
@overload
@classmethod
def now(cls: Type[_S], tz: None = ...) -> _S: ...
def now(cls: type[_S], tz: None = ...) -> _S: ...
@overload
@classmethod
def now(cls, tz: _tzinfo) -> datetime: ...
@classmethod
def utcnow(cls: Type[_S]) -> _S: ...
def utcnow(cls: type[_S]) -> _S: ...
@classmethod
def combine(cls, date: _date, time: _time, tzinfo: _tzinfo | None = ...) -> datetime: ...
if sys.version_info >= (3, 7):
@classmethod
def fromisoformat(cls: Type[_S], __date_string: str) -> _S: ...
def fromisoformat(cls: type[_S], __date_string: str) -> _S: ...
def timestamp(self) -> float: ...
def utctimetuple(self) -> struct_time: ...
def date(self) -> _date: ...