diff --git a/newsfragments/215.bugfix.rst b/newsfragments/215.bugfix.rst new file mode 100644 index 0000000..6f970eb --- /dev/null +++ b/newsfragments/215.bugfix.rst @@ -0,0 +1 @@ +Add type annotation for iterdir. \ No newline at end of file diff --git a/path/__init__.pyi b/path/__init__.pyi index 1031f3e..99642a8 100644 --- a/path/__init__.pyi +++ b/path/__init__.pyi @@ -113,6 +113,7 @@ class Path(str): def relpath(self: Self, start: str = ...) -> Self: ... def relpathto(self: Self, dest: str) -> Self: ... # --- Listing, searching, walking, and matching + def iterdir(self: Self) -> Iterator[Self]: ... def listdir(self: Self, match: _Match = ...) -> List[Self]: ... def dirs(self: Self, match: _Match = ...) -> List[Self]: ... def files(self: Self, match: _Match = ...) -> List[Self]: ...