From bb621b227541dc068b4c77b21f83ba746c2f5746 Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Fri, 6 Oct 2023 15:17:34 -0700 Subject: [PATCH] Add typing to ContextManager.__init__ --- src/watchdog/utils/dirsnapshot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/watchdog/utils/dirsnapshot.py b/src/watchdog/utils/dirsnapshot.py index 90a6f41d..8cd843f0 100644 --- a/src/watchdog/utils/dirsnapshot.py +++ b/src/watchdog/utils/dirsnapshot.py @@ -256,11 +256,11 @@ class ContextManager: def __init__( self, - path, - recursive=True, - stat=os.stat, - listdir=os.scandir, - ignore_device=False, + path: str, + recursive: bool = True, + stat: Callable[[str], os.stat_result] = os.stat, + listdir: Callable[[Optional[str]], Iterator[os.DirEntry]] = os.scandir, + ignore_device: bool = False, ): self.path = path self.recursive = recursive