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

@@ -5,7 +5,7 @@ from _typeshed import Self, StrOrBytesPath, StrPath
from collections.abc import Callable, Iterable, Iterator, Mapping
from gzip import _ReadableFileobj as _GzipReadableFileobj, _WritableFileobj as _GzipWritableFileobj
from types import TracebackType
from typing import IO, Protocol, Type, TypeVar, overload
from typing import IO, Protocol, TypeVar, overload
from typing_extensions import Literal
_TF = TypeVar("_TF", bound=TarFile)
@@ -78,7 +78,7 @@ def open(
bufsize: int = ...,
*,
format: int | None = ...,
tarinfo: Type[TarInfo] | None = ...,
tarinfo: type[TarInfo] | None = ...,
dereference: bool | None = ...,
ignore_zeros: bool | None = ...,
encoding: str | None = ...,
@@ -100,12 +100,12 @@ class TarFile:
mode: Literal["r", "a", "w", "x"]
fileobj: _Fileobj | None
format: int | None
tarinfo: Type[TarInfo]
tarinfo: type[TarInfo]
dereference: bool | None
ignore_zeros: bool | None
encoding: str | None
errors: str
fileobject: Type[ExFileObject]
fileobject: type[ExFileObject]
pax_headers: Mapping[str, str] | None
debug: int | None
errorlevel: int | None
@@ -116,7 +116,7 @@ class TarFile:
mode: Literal["r", "a", "w", "x"] = ...,
fileobj: _Fileobj | None = ...,
format: int | None = ...,
tarinfo: Type[TarInfo] | None = ...,
tarinfo: type[TarInfo] | None = ...,
dereference: bool | None = ...,
ignore_zeros: bool | None = ...,
encoding: str | None = ...,
@@ -128,19 +128,19 @@ class TarFile:
) -> None: ...
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> None: ...
def __iter__(self) -> Iterator[TarInfo]: ...
@classmethod
def open(
cls: Type[_TF],
cls: type[_TF],
name: StrOrBytesPath | None = ...,
mode: str = ...,
fileobj: IO[bytes] | None = ..., # depends on mode
bufsize: int = ...,
*,
format: int | None = ...,
tarinfo: Type[TarInfo] | None = ...,
tarinfo: type[TarInfo] | None = ...,
dereference: bool | None = ...,
ignore_zeros: bool | None = ...,
encoding: str | None = ...,
@@ -151,14 +151,14 @@ class TarFile:
) -> _TF: ...
@classmethod
def taropen(
cls: Type[_TF],
cls: type[_TF],
name: StrOrBytesPath | None,
mode: Literal["r", "a", "w", "x"] = ...,
fileobj: _Fileobj | None = ...,
*,
compresslevel: int = ...,
format: int | None = ...,
tarinfo: Type[TarInfo] | None = ...,
tarinfo: type[TarInfo] | None = ...,
dereference: bool | None = ...,
ignore_zeros: bool | None = ...,
encoding: str | None = ...,
@@ -169,14 +169,14 @@ class TarFile:
@overload
@classmethod
def gzopen(
cls: Type[_TF],
cls: type[_TF],
name: StrOrBytesPath | None,
mode: Literal["r"] = ...,
fileobj: _GzipReadableFileobj | None = ...,
compresslevel: int = ...,
*,
format: int | None = ...,
tarinfo: Type[TarInfo] | None = ...,
tarinfo: type[TarInfo] | None = ...,
dereference: bool | None = ...,
ignore_zeros: bool | None = ...,
encoding: str | None = ...,
@@ -187,14 +187,14 @@ class TarFile:
@overload
@classmethod
def gzopen(
cls: Type[_TF],
cls: type[_TF],
name: StrOrBytesPath | None,
mode: Literal["w", "x"],
fileobj: _GzipWritableFileobj | None = ...,
compresslevel: int = ...,
*,
format: int | None = ...,
tarinfo: Type[TarInfo] | None = ...,
tarinfo: type[TarInfo] | None = ...,
dereference: bool | None = ...,
ignore_zeros: bool | None = ...,
encoding: str | None = ...,
@@ -205,14 +205,14 @@ class TarFile:
@overload
@classmethod
def bz2open(
cls: Type[_TF],
cls: type[_TF],
name: StrOrBytesPath | None,
mode: Literal["w", "x"],
fileobj: _Bz2WritableFileobj | None = ...,
compresslevel: int = ...,
*,
format: int | None = ...,
tarinfo: Type[TarInfo] | None = ...,
tarinfo: type[TarInfo] | None = ...,
dereference: bool | None = ...,
ignore_zeros: bool | None = ...,
encoding: str | None = ...,
@@ -223,14 +223,14 @@ class TarFile:
@overload
@classmethod
def bz2open(
cls: Type[_TF],
cls: type[_TF],
name: StrOrBytesPath | None,
mode: Literal["r"] = ...,
fileobj: _Bz2ReadableFileobj | None = ...,
compresslevel: int = ...,
*,
format: int | None = ...,
tarinfo: Type[TarInfo] | None = ...,
tarinfo: type[TarInfo] | None = ...,
dereference: bool | None = ...,
ignore_zeros: bool | None = ...,
encoding: str | None = ...,
@@ -240,14 +240,14 @@ class TarFile:
) -> _TF: ...
@classmethod
def xzopen(
cls: Type[_TF],
cls: type[_TF],
name: StrOrBytesPath | None,
mode: Literal["r", "w", "x"] = ...,
fileobj: IO[bytes] | None = ...,
preset: int | None = ...,
*,
format: int | None = ...,
tarinfo: Type[TarInfo] | None = ...,
tarinfo: type[TarInfo] | None = ...,
dereference: bool | None = ...,
ignore_zeros: bool | None = ...,
encoding: str | None = ...,