changeset 49600:b6fc602e074a

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.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 08 Nov 2022 14:31:10 -0500
parents 94a797032fc4
children 8009a89bc18b
files mercurial/cext/osutil.pyi
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: ...