Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 52904:acaf6bad6b89
typing: adds annotation to util.hooks
This prepare the introduction of a typing.Protocol for it.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 09 Feb 2025 22:45:16 +0100 |
parents | abcfb4ce132e |
children | 483b0bb23085 |
line wrap: on
line diff
--- a/mercurial/util.py Thu Dec 12 17:50:06 2024 +0000 +++ b/mercurial/util.py Sun Feb 09 22:45:16 2025 +0100 @@ -3192,10 +3192,10 @@ def __init__(self): self._hooks = [] - def add(self, source, hook): + def add(self, source: bytes, hook: Callable) -> None: self._hooks.append((source, hook)) - def __call__(self, *args): + def __call__(self, *args) -> List: self._hooks.sort(key=lambda x: x[0]) results = [] for source, hook in self._hooks: