mercurial/utils/urlutil.py
changeset 51670 a09435c0eb14
parent 51287 f15cb5111a1e
child 51864 1c5810ce737e
--- a/mercurial/utils/urlutil.py	Wed Jul 10 15:49:16 2024 -0400
+++ b/mercurial/utils/urlutil.py	Wed Jul 10 16:04:53 2024 -0400
@@ -9,6 +9,9 @@
 import socket
 
 from typing import (
+    Callable,
+    Dict,
+    Tuple,
     Union,
 )
 
@@ -29,7 +32,7 @@
 )
 
 # keeps pyflakes happy
-assert [Union]
+assert [Callable, Dict, Tuple, Union]
 
 urlreq = urllibcompat.urlreq
 
@@ -652,12 +655,12 @@
             self[name] = new_paths
 
 
-_pathsuboptions = {}
+_pathsuboptions: "Dict[bytes, Tuple[str, Callable]]" = {}
 # a dictionnary of methods that can be used to format a sub-option value
 path_suboptions_display = {}
 
 
-def pathsuboption(option, attr, display=pycompat.bytestr):
+def pathsuboption(option: bytes, attr: str, display=pycompat.bytestr):
     """Decorator used to declare a path sub-option.
 
     Arguments are the sub-option name and the attribute it should set on