diff --git a/stdlib/zipfile.pyi b/stdlib/zipfile.pyi index abda7a3b9..dc07eb3f2 100644 --- a/stdlib/zipfile.pyi +++ b/stdlib/zipfile.pyi @@ -257,7 +257,11 @@ if sys.version_info >= (3, 8): @property def open(self) -> _PathOpenProtocol: ... - def iterdir(self) -> Iterator[Path]: ... + if sys.version_info >= (3, 10): + def iterdir(self) -> Iterator[Self]: ... + else: + def iterdir(self) -> Iterator[Path]: ... + def is_dir(self) -> bool: ... def is_file(self) -> bool: ... def exists(self) -> bool: ... @@ -274,6 +278,14 @@ if sys.version_info >= (3, 8): def joinpath(self, *other: StrPath) -> Path: ... else: def joinpath(self, add: StrPath) -> Path: ... # undocumented + if sys.version_info >= (3, 12): + def glob(self, pattern: str) -> Iterator[Self]: ... + def rglob(self, pattern: str) -> Iterator[Self]: ... + def is_symlink(self) -> Literal[False]: ... + def relative_to(self, other: Path, *extra: StrPath) -> str: ... + def match(self, path_pattern: str) -> bool: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... def __truediv__(self, add: StrPath) -> Path: ... diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index a46c49cc5..abcff8467 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -34,11 +34,6 @@ typing_extensions.SupportsAbs.__type_params__ typing_extensions.SupportsRound.__type_params__ urllib.request.AbstractHTTPHandler.__init__ urllib.request.HTTPSHandler.__init__ -zipfile.Path.glob -zipfile.Path.is_symlink -zipfile.Path.match -zipfile.Path.relative_to -zipfile.Path.rglob # TODO: remove after rc2 release turtle.__all__