diff --git a/stubs/typed-ast/typed_ast/ast27.pyi b/stubs/typed-ast/typed_ast/ast27.pyi index 4faf50e6683f..ff3ccdcc86d8 100644 --- a/stubs/typed-ast/typed_ast/ast27.pyi +++ b/stubs/typed-ast/typed_ast/ast27.pyi @@ -1,3 +1,4 @@ +from _typeshed import ReadableBuffer from collections.abc import Iterator from typing import Any from typing_extensions import TypeAlias @@ -9,11 +10,11 @@ class NodeVisitor: class NodeTransformer(NodeVisitor): def generic_visit(self, node: AST) -> None: ... -def parse(source: str | bytes, filename: str | bytes = ..., mode: str = ...) -> AST: ... +def parse(source: str | ReadableBuffer, filename: str | ReadableBuffer = ..., mode: str = ...) -> AST: ... 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: ... -def get_docstring(node: AST, clean: bool = ...) -> bytes | None: ... +def get_docstring(node: AST, clean: bool = ...) -> str | bytes | None: ... def increment_lineno(node: AST, n: int = ...) -> AST: ... def iter_child_nodes(node: AST) -> Iterator[AST]: ... def iter_fields(node: AST) -> Iterator[tuple[str, Any]]: ... diff --git a/stubs/typed-ast/typed_ast/ast3.pyi b/stubs/typed-ast/typed_ast/ast3.pyi index 1acf9315ba0c..230a6ac99b03 100644 --- a/stubs/typed-ast/typed_ast/ast3.pyi +++ b/stubs/typed-ast/typed_ast/ast3.pyi @@ -1,3 +1,4 @@ +from _typeshed import ReadableBuffer from collections.abc import Iterator from typing import Any from typing_extensions import TypeAlias @@ -9,7 +10,9 @@ class NodeVisitor: class NodeTransformer(NodeVisitor): def generic_visit(self, node: AST) -> None: ... -def parse(source: str | bytes, filename: str | bytes = ..., mode: str = ..., feature_version: int = ...) -> AST: ... +def parse( + source: str | ReadableBuffer, filename: str | ReadableBuffer = ..., mode: str = ..., feature_version: int = ... +) -> AST: ... 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: ...