Switch to PEP-604 syntax in python2 stubs (#5915)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2021-08-14 11:12:30 +02:00
committed by GitHub
parent 431c4f7fc1
commit ff63953188
235 changed files with 2473 additions and 2768 deletions

View File

@@ -4,12 +4,12 @@
# from _ast below when loaded in an unorthodox way by the Dropbox
# internal Bazel integration.
import typing as _typing
from typing import Any, Iterator, Optional, Union
from typing import Any, Iterator
from _ast import *
from _ast import AST, Module
def parse(source: Union[str, unicode], filename: Union[str, unicode] = ..., mode: Union[str, unicode] = ...) -> Module: ...
def parse(source: str | unicode, filename: str | unicode = ..., mode: str | unicode = ...) -> Module: ...
def copy_location(new_node: AST, old_node: AST) -> AST: ...
def dump(node: AST, annotate_fields: bool = ..., include_attributes: bool = ...) -> str: ...
def fix_missing_locations(node: AST) -> AST: ...
@@ -17,7 +17,7 @@ def get_docstring(node: AST, clean: bool = ...) -> str: ...
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 literal_eval(node_or_string: Union[str, unicode, AST]) -> Any: ...
def literal_eval(node_or_string: str | unicode | AST) -> Any: ...
def walk(node: AST) -> Iterator[AST]: ...
class NodeVisitor:
@@ -25,4 +25,4 @@ class NodeVisitor:
def generic_visit(self, node: AST) -> Any: ...
class NodeTransformer(NodeVisitor):
def generic_visit(self, node: AST) -> Optional[AST]: ...
def generic_visit(self, node: AST) -> AST | None: ...