|
15 | 15 | from pathlib._os import magic_open, ensure_distinct_paths, ensure_different_files, copyfileobj |
16 | 16 | from pathlib import PurePath, Path |
17 | 17 | from typing import ( |
18 | | - Any, BinaryIO, Callable, Generator, Optional, Protocol, Sequence, TypeVar, Union, |
| 18 | + Any, BinaryIO, Callable, Generator, Iterator, Optional, Protocol, Sequence, TypeVar, Union, |
19 | 19 | runtime_checkable, |
20 | 20 | ) |
21 | 21 |
|
@@ -283,15 +283,15 @@ def read_text( |
283 | 283 | return f.read() |
284 | 284 |
|
285 | 285 | @abstractmethod |
286 | | - def iterdir(self: _RP) -> Generator[_RP, None, None]: |
| 286 | + def iterdir(self: _RP) -> Iterator[_RP]: |
287 | 287 | """Yield path objects of the directory contents. |
288 | 288 |
|
289 | 289 | The children are yielded in arbitrary order, and the |
290 | 290 | special entries '.' and '..' are not included. |
291 | 291 | """ |
292 | 292 | raise NotImplementedError |
293 | 293 |
|
294 | | - def glob(self: _RP, pattern: Union[_RP, str], *, recurse_symlinks: bool = True) -> Generator[_RP, None, None]: |
| 294 | + def glob(self: _RP, pattern: Union[_RP, str], *, recurse_symlinks: bool = True) -> Iterator[_RP]: |
295 | 295 | """Iterate over this subtree and yield all existing files (of any |
296 | 296 | kind, including directories) matching the given relative pattern. |
297 | 297 | """ |
|
0 commit comments