|
45 | 45 | ]
|
46 | 46 |
|
47 | 47 |
|
48 |
| -def _insert_hookimpl_into_list( |
49 |
| - hookimpl: _T_HookImpl, target_list: MutableSequence[_T_HookImpl] |
50 |
| -) -> None: |
51 |
| - """Insert a hookimpl into the target list maintaining proper ordering. |
52 |
| -
|
53 |
| - The ordering is: [trylast, normal, tryfirst] |
54 |
| - """ |
55 |
| - if hookimpl.trylast: |
56 |
| - target_list.insert(0, hookimpl) |
57 |
| - elif hookimpl.tryfirst: |
58 |
| - target_list.append(hookimpl) |
59 |
| - else: |
60 |
| - # find last non-tryfirst method |
61 |
| - i = len(target_list) - 1 |
62 |
| - while i >= 0 and target_list[i].tryfirst: |
63 |
| - i -= 1 |
64 |
| - target_list.insert(i + 1, hookimpl) |
65 |
| - |
66 |
| - |
67 |
| -_T_HookImpl = TypeVar("_T_HookImpl", bound="HookImpl") |
68 |
| - |
69 |
| -# Type alias for completion hook functions |
70 |
| -CompletionHook = Callable[ |
71 |
| - [object | list[object] | None, BaseException | None], |
72 |
| - tuple[object | list[object] | None, BaseException | None], |
73 |
| -] |
74 |
| - |
75 |
| - |
76 | 48 | def _insert_hookimpl_into_list(
|
77 | 49 | hookimpl: _T_HookImpl, target_list: MutableSequence[_T_HookImpl]
|
78 | 50 | ) -> None:
|
@@ -592,10 +564,6 @@ def __call__(self, **kwargs: object) -> Any:
|
592 | 564 | self._orig._async_submitter,
|
593 | 565 | )
|
594 | 566 |
|
595 |
| - normal_impls = self._get_filtered(self._orig._normal_hookimpls) |
596 |
| - wrapper_impls = self._get_filtered(self._orig._wrapper_hookimpls) |
597 |
| - return hookexec(self.name, normal_impls, wrapper_impls, kwargs, firstresult) |
598 |
| - |
599 | 567 | def call_historic(
|
600 | 568 | self,
|
601 | 569 | result_callback: Callable[[Any], None] | None = None,
|
@@ -713,18 +681,6 @@ class HookImpl:
|
713 | 681 | trylast: Final[bool]
|
714 | 682 | hookimpl_config: Final[HookimplConfiguration]
|
715 | 683 |
|
716 |
| - function: Final[_HookImplFunction[object]] |
717 |
| - argnames: Final[tuple[str, ...]] |
718 |
| - kwargnames: Final[tuple[str, ...]] |
719 |
| - plugin: Final[_Plugin] |
720 |
| - plugin_name: Final[str] |
721 |
| - wrapper: Final[bool] |
722 |
| - hookwrapper: Final[bool] |
723 |
| - optionalhook: Final[bool] |
724 |
| - tryfirst: Final[bool] |
725 |
| - trylast: Final[bool] |
726 |
| - hookimpl_config: Final[HookimplConfiguration] |
727 |
| - |
728 | 684 | def __init__(
|
729 | 685 | self,
|
730 | 686 | plugin: _Plugin,
|
|
0 commit comments