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,32 +1,32 @@
from _warnings import warn as warn, warn_explicit as warn_explicit
from types import ModuleType, TracebackType
from typing import Any, Sequence, TextIO, Type, overload
from typing import Any, Sequence, TextIO, overload
from typing_extensions import Literal
_ActionKind = Literal["default", "error", "ignore", "always", "module", "once"]
filters: Sequence[tuple[str, str | None, Type[Warning], str | None, int]] # undocumented, do not mutate
filters: Sequence[tuple[str, str | None, type[Warning], str | None, int]] # undocumented, do not mutate
def showwarning(
message: Warning | str, category: Type[Warning], filename: str, lineno: int, file: TextIO | None = ..., line: str | None = ...
message: Warning | str, category: type[Warning], filename: str, lineno: int, file: TextIO | None = ..., line: str | None = ...
) -> None: ...
def formatwarning(message: Warning | str, category: Type[Warning], filename: str, lineno: int, line: str | None = ...) -> str: ...
def formatwarning(message: Warning | str, category: type[Warning], filename: str, lineno: int, line: str | None = ...) -> str: ...
def filterwarnings(
action: _ActionKind,
message: str = ...,
category: Type[Warning] = ...,
category: type[Warning] = ...,
module: str = ...,
lineno: int = ...,
append: bool = ...,
) -> None: ...
def simplefilter(action: _ActionKind, category: Type[Warning] = ..., lineno: int = ..., append: bool = ...) -> None: ...
def simplefilter(action: _ActionKind, category: type[Warning] = ..., lineno: int = ..., append: bool = ...) -> None: ...
def resetwarnings() -> None: ...
class _OptionError(Exception): ...
class WarningMessage:
message: Warning | str
category: Type[Warning]
category: type[Warning]
filename: str
lineno: int
file: TextIO | None
@@ -35,7 +35,7 @@ class WarningMessage:
def __init__(
self,
message: Warning | str,
category: Type[Warning],
category: type[Warning],
filename: str,
lineno: int,
file: TextIO | None = ...,
@@ -52,7 +52,7 @@ class catch_warnings:
def __new__(cls, *, record: bool, module: ModuleType | None = ...) -> catch_warnings: ...
def __enter__(self) -> list[WarningMessage] | None: ...
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: ...
class _catch_warnings_without_records(catch_warnings):