From 9c40557c477baefe2d58fe0183ef2653ce1c402f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 4 Apr 2024 05:11:23 -0400 Subject: [PATCH] Add type annotation for iterdir. Closes #215. --- newsfragments/215.bugfix.rst | 1 + path/__init__.pyi | 1 + 2 files changed, 2 insertions(+) create mode 100644 newsfragments/215.bugfix.rst diff --git a/newsfragments/215.bugfix.rst b/newsfragments/215.bugfix.rst new file mode 100644 index 00000000..6f970eb8 --- /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 1031f3e2..99642a8e 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]: ...