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,4 +1,4 @@
from typing import Any, Callable, Type, TypeVar, overload
from typing import Any, Callable, TypeVar, overload
from typing_extensions import Literal
_F = TypeVar("_F", bound=Callable[..., Any])
@@ -8,9 +8,9 @@ class ClassicAdapter:
reason: str
version: str
action: _Actions | None
category: Type[Warning]
category: type[Warning]
def __init__(
self, reason: str = ..., version: str = ..., action: _Actions | None = ..., category: Type[Warning] = ...
self, reason: str = ..., version: str = ..., action: _Actions | None = ..., category: type[Warning] = ...
) -> None: ...
def get_deprecated_msg(self, wrapped: Callable[..., Any], instance: object) -> str: ...
def __call__(self, wrapped: _F) -> Callable[[_F], _F]: ...
@@ -19,5 +19,5 @@ class ClassicAdapter:
def deprecated(__wrapped: _F) -> _F: ...
@overload
def deprecated(
reason: str = ..., *, version: str = ..., action: _Actions | None = ..., category: Type[Warning] | None = ...
reason: str = ..., *, version: str = ..., action: _Actions | None = ..., category: type[Warning] | None = ...
) -> Callable[[_F], _F]: ...

View File

@@ -1,4 +1,4 @@
from typing import Any, Callable, Type, TypeVar
from typing import Any, Callable, TypeVar
from typing_extensions import Literal
from .classic import ClassicAdapter, _Actions
@@ -10,14 +10,14 @@ class SphinxAdapter(ClassicAdapter):
reason: str
version: str
action: _Actions | None
category: Type[Warning]
category: type[Warning]
def __init__(
self,
directive: Literal["versionadded", "versionchanged", "deprecated"],
reason: str = ...,
version: str = ...,
action: _Actions | None = ...,
category: Type[Warning] = ...,
category: type[Warning] = ...,
) -> None: ...
def __call__(self, wrapped: _F) -> Callable[[_F], _F]: ...
@@ -29,5 +29,5 @@ def deprecated(
line_length: int = ...,
*,
action: _Actions | None = ...,
category: Type[Warning] | None = ...,
category: type[Warning] | None = ...,
) -> Callable[[_F], _F]: ...