Mercurial > hg
diff mercurial/typelib.py @ 51732:43460c311c0c
typing: add trivial type hints to `mercurial.scmutil`
There's still a lot to go, but there's a lot here already, so I tried to keep it
to obvious/trivial things. I didn't bother with contexts, matchers, and
revisions that can be `bytes | int | None`.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 24 Jul 2024 22:40:22 -0400 |
parents | f3b34386d3e0 |
children | 1c5810ce737e |
line wrap: on
line diff
--- a/mercurial/typelib.py Wed Jul 24 18:17:00 2024 -0400 +++ b/mercurial/typelib.py Wed Jul 24 22:40:22 2024 -0400 @@ -7,6 +7,10 @@ import typing +from typing import ( + Callable, +) + # Note: this is slightly different from pycompat.TYPE_CHECKING, as using # pycompat causes the BinaryIO_Proxy type to be resolved to ``object`` when # used as the base class during a pytype run. @@ -39,3 +43,6 @@ BinaryIO_Proxy = object CacheStat = Any NodeConstants = Any + +# scmutil.getuipathfn() related callback. +UiPathFn = Callable[[bytes], bytes]