Skip to content

Commit 9674ec2

Browse files
committed
Weaken return type of Path.{glob,rglob} in 3.13
Since python/cpython#117589 (at least), `Path.glob` and `Path.rglob` return an `Iterator` rather than a `Generator`.
1 parent dc6b89c commit 9674ec2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/pathlib.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ class Path(PurePath):
131131
if sys.version_info >= (3, 13):
132132
def glob(
133133
self, pattern: str, *, case_sensitive: bool | None = None, recurse_symlinks: bool = False
134-
) -> Generator[Self, None, None]: ...
134+
) -> Iterator[Self]: ...
135135
def rglob(
136136
self, pattern: str, *, case_sensitive: bool | None = None, recurse_symlinks: bool = False
137-
) -> Generator[Self, None, None]: ...
137+
) -> Iterator[Self]: ...
138138
elif sys.version_info >= (3, 12):
139139
def glob(self, pattern: str, *, case_sensitive: bool | None = None) -> Generator[Self, None, None]: ...
140140
def rglob(self, pattern: str, *, case_sensitive: bool | None = None) -> Generator[Self, None, None]: ...

0 commit comments

Comments
 (0)