mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-26 02:08:42 +08:00
Use PEP 585 syntax wherever possible (#6717)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import typing
|
||||
from typing import Any, Iterator
|
||||
|
||||
class NodeVisitor:
|
||||
@@ -15,7 +14,7 @@ def fix_missing_locations(node: AST) -> AST: ...
|
||||
def get_docstring(node: AST, clean: bool = ...) -> bytes | None: ...
|
||||
def increment_lineno(node: AST, n: int = ...) -> AST: ...
|
||||
def iter_child_nodes(node: AST) -> Iterator[AST]: ...
|
||||
def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ...
|
||||
def iter_fields(node: AST) -> Iterator[tuple[str, Any]]: ...
|
||||
def literal_eval(node_or_string: str | AST) -> Any: ...
|
||||
def walk(node: AST) -> Iterator[AST]: ...
|
||||
|
||||
@@ -26,8 +25,8 @@ PyCF_ONLY_AST: int
|
||||
identifier = str
|
||||
|
||||
class AST:
|
||||
_attributes: typing.Tuple[str, ...]
|
||||
_fields: typing.Tuple[str, ...]
|
||||
_attributes: tuple[str, ...]
|
||||
_fields: tuple[str, ...]
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
class mod(AST): ...
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import typing
|
||||
from typing import Any, Iterator
|
||||
|
||||
class NodeVisitor:
|
||||
@@ -15,7 +14,7 @@ def fix_missing_locations(node: AST) -> AST: ...
|
||||
def get_docstring(node: AST, clean: bool = ...) -> str | None: ...
|
||||
def increment_lineno(node: AST, n: int = ...) -> AST: ...
|
||||
def iter_child_nodes(node: AST) -> Iterator[AST]: ...
|
||||
def iter_fields(node: AST) -> Iterator[typing.Tuple[str, Any]]: ...
|
||||
def iter_fields(node: AST) -> Iterator[tuple[str, Any]]: ...
|
||||
def literal_eval(node_or_string: str | AST) -> Any: ...
|
||||
def walk(node: AST) -> Iterator[AST]: ...
|
||||
|
||||
@@ -26,8 +25,8 @@ PyCF_ONLY_AST: int
|
||||
identifier = str
|
||||
|
||||
class AST:
|
||||
_attributes: typing.Tuple[str, ...]
|
||||
_fields: typing.Tuple[str, ...]
|
||||
_attributes: tuple[str, ...]
|
||||
_fields: tuple[str, ...]
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
class mod(AST): ...
|
||||
|
||||
Reference in New Issue
Block a user