35
35
36
36
from ._result import Result
37
37
38
-
39
38
_T = TypeVar ("_T" )
40
39
_F = TypeVar ("_F" , bound = Callable [..., object ])
41
40
_Namespace = Union [ModuleType , type ]
46
45
_HookImplFunction = Callable [..., Union [_T , Generator [None , Result [_T ], None ]]]
47
46
_CallHistory = List [Tuple [Mapping [str , object ], Optional [Callable [[Any ], None ]]]]
48
47
49
-
50
48
class HookspecOpts (TypedDict ):
51
49
"""Options for a hook specification."""
52
50
@@ -62,7 +60,6 @@ class HookspecOpts(TypedDict):
62
60
#: .. versionadded:: 1.5
63
61
warn_on_impl_args : Mapping [str , Warning ] | None
64
62
65
-
66
63
class HookimplOpts (TypedDict ):
67
64
"""Options for a hook implementation."""
68
65
@@ -84,11 +81,11 @@ class HookimplOpts(TypedDict):
84
81
specname : str | None
85
82
86
83
else :
84
+
87
85
def final (func : _F ) -> _F :
88
86
return func
89
- overload = final
90
-
91
87
88
+ overload = final
92
89
93
90
94
91
@final
@@ -388,6 +385,7 @@ def __init__(self) -> None:
388
385
389
386
def __getattr__ (self , name : str ) -> HookCaller : ...
390
387
388
+ _CallHistory = List [Tuple [Mapping [str , object ], Optional [Callable [[Any ], None ]]]]
391
389
392
390
# Historical name (pluggy<=1.2), kept for backward compatibility.
393
391
_HookRelay = HookRelay
0 commit comments