Use PEP 585 syntax wherever possible (#6717)

This commit is contained in:
Alex Waygood
2021-12-28 10:31:43 +00:00
committed by GitHub
parent e6cb341d94
commit 8d5d2520ac
237 changed files with 966 additions and 1069 deletions
+3 -4
View File
@@ -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): ...
+3 -4
View File
@@ -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): ...