typing: fix the typehint for `skip` arg on `osutil.listdir()` to be optional
authorMatt Harbison <matt_harbison@yahoo.com>
Tue, 08 Nov 2022 14:31:10 -0500
changeset 49600 b6fc602e074a
parent 49599 94a797032fc4
child 49601 8009a89bc18b
typing: fix the typehint for `skip` arg on `osutil.listdir()` to be optional The cffi and pure implementations both default to `None`, and the args are parsed in C with `"y#|OO:listdir"`, with the C variable initialized to NULL.
mercurial/cext/osutil.pyi
--- a/mercurial/cext/osutil.pyi	Tue Nov 08 14:17:56 2022 -0500
+++ b/mercurial/cext/osutil.pyi	Tue Nov 08 14:31:10 2022 -0500
@@ -2,6 +2,7 @@
     AnyStr,
     IO,
     List,
+    Optional,
     Sequence,
 )
 
@@ -15,7 +16,7 @@
     st_mtime: int
     st_ctime: int
 
-def listdir(path: bytes, st: bool, skip: bool) -> List[stat]: ...
+def listdir(path: bytes, st: bool, skip: Optional[bool]) -> List[stat]: ...
 def posixfile(name: AnyStr, mode: bytes, buffering: int) -> IO: ...
 def statfiles(names: Sequence[bytes]) -> List[stat]: ...
 def setprocname(name: bytes) -> None: ...