mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-23 20:31:32 +08:00
Use lowercase type everywhere (#6853)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import argparse
|
||||
import ast
|
||||
from typing import Any, Generic, Iterable, Iterator, Type, TypeVar
|
||||
from typing import Any, Generic, Iterable, Iterator, TypeVar
|
||||
|
||||
FLAKE8_ERROR = tuple[int, int, str, Type[Any]]
|
||||
FLAKE8_ERROR = tuple[int, int, str, type[Any]]
|
||||
TConfig = TypeVar("TConfig") # noqa: Y001
|
||||
|
||||
class Error:
|
||||
@@ -19,12 +19,12 @@ class Visitor(ast.NodeVisitor, Generic[TConfig]):
|
||||
def __init__(self, config: TConfig | None = ...) -> None: ...
|
||||
@property
|
||||
def config(self) -> TConfig: ...
|
||||
def error_from_node(self, error: Type[Error], node: ast.AST, **kwargs: Any) -> None: ...
|
||||
def error_from_node(self, error: type[Error], node: ast.AST, **kwargs: Any) -> None: ...
|
||||
|
||||
class Plugin(Generic[TConfig]):
|
||||
name: str
|
||||
version: str
|
||||
visitors: list[Type[Visitor[TConfig]]]
|
||||
visitors: list[type[Visitor[TConfig]]]
|
||||
config: TConfig
|
||||
def __init__(self, tree: ast.AST) -> None: ...
|
||||
def run(self) -> Iterable[FLAKE8_ERROR]: ...
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from typing import Any, Type
|
||||
from typing import Any
|
||||
|
||||
from ..plugin import Error as Error, TConfig as TConfig, Visitor as Visitor
|
||||
|
||||
def assert_error(
|
||||
visitor_cls: Type[Visitor[TConfig]], src: str, expected: Type[Error], config: TConfig | None = ..., **kwargs: Any
|
||||
visitor_cls: type[Visitor[TConfig]], src: str, expected: type[Error], config: TConfig | None = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
def assert_not_error(visitor_cls: Type[Visitor[TConfig]], src: str, config: TConfig | None = ...) -> None: ...
|
||||
def assert_not_error(visitor_cls: type[Visitor[TConfig]], src: str, config: TConfig | None = ...) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user