From 3caac29d097a31f43752d8c02e3b2ce86915c59f Mon Sep 17 00:00:00 2001 From: ltsyk Date: Thu, 30 Jul 2026 08:43:29 +0800 Subject: [PATCH] fix: add return type annotation to Path.cwd() Annotate Path.cwd() -> Self (issue #243) --- path/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/path/__init__.py b/path/__init__.py index 33dd979..b2d4c46 100644 --- a/path/__init__.py +++ b/path/__init__.py @@ -251,7 +251,7 @@ def __exit__(self, *_) -> None: os.chdir(self._old_dir) @classmethod - def cwd(cls): + def cwd(cls) -> Self: """Return the current working directory as a path object. .. seealso:: :func:`os.getcwd`