diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index bfbf9cd9f..8caa76c90 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -251,7 +251,6 @@ ast.arg.__annotations_cache__ ast.arguments.__annotations_cache__ ast.comprehension.__annotations_cache__ ast.keyword.__annotations_cache__ -ast.main ast.match_case.__annotations_cache__ ast.withitem.__annotations_cache__ asyncio.__all__ diff --git a/stdlib/ast.pyi b/stdlib/ast.pyi index bced1cb45..64dc5f2af 100644 --- a/stdlib/ast.pyi +++ b/stdlib/ast.pyi @@ -7,7 +7,7 @@ from _ast import ( PyCF_TYPE_COMMENTS as PyCF_TYPE_COMMENTS, ) from _typeshed import ReadableBuffer, Unused -from collections.abc import Iterable, Iterator +from collections.abc import Iterable, Iterator, Sequence from typing import Any, ClassVar, Generic, Literal, TypedDict, TypeVar as _TypeVar, overload from typing_extensions import Self, Unpack, deprecated @@ -2016,4 +2016,9 @@ class NodeTransformer(NodeVisitor): # is also allowed in some cases -- this needs to be mapped. def unparse(ast_obj: AST) -> str: ... -def main() -> None: ... + +if sys.version_info >= (3, 14): + def main(args: Sequence[str] | None = None) -> None: ... + +else: + def main() -> None: ...