Skip to content

Commit

Permalink
Add typing to ContextManager.__init__
Browse files Browse the repository at this point in the history
  • Loading branch information
msabramo committed Oct 6, 2023
1 parent 715b6e3 commit e486f42
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/watchdog/utils/dirsnapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import errno
import os
from stat import S_ISDIR
from typing import Callable, Iterator, Optional


class DirectorySnapshotDiff:
Expand Down Expand Up @@ -250,11 +251,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
Expand Down

0 comments on commit e486f42

Please sign in to comment.