-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f087cee
commit 85197cb
Showing
4 changed files
with
61 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from typing import Mapping | ||
from typing import TypedDict | ||
import warnings | ||
|
||
|
||
warnings.warn(ImportWarning(f"{__name__} imported outside of type checking")) | ||
|
||
|
||
class HookspecOpts(TypedDict): | ||
"""Options for a hook specification.""" | ||
|
||
#: Whether the hook is :ref:`first result only <firstresult>`. | ||
firstresult: bool | ||
#: Whether the hook is :ref:`historic <historic>`. | ||
historic: bool | ||
#: Whether the hook :ref:`warns when implemented <warn_on_impl>`. | ||
warn_on_impl: Warning | None | ||
#: Whether the hook warns when :ref:`certain arguments are requested | ||
#: <warn_on_impl>`. | ||
#: | ||
#: .. versionadded:: 1.5 | ||
warn_on_impl_args: Mapping[str, Warning] | None | ||
|
||
|
||
class HookimplOpts(TypedDict): | ||
"""Options for a hook implementation.""" | ||
|
||
#: Whether the hook implementation is a :ref:`wrapper <hookwrapper>`. | ||
wrapper: bool | ||
#: Whether the hook implementation is an :ref:`old-style wrapper | ||
#: <old_style_hookwrappers>`. | ||
hookwrapper: bool | ||
#: Whether validation against a hook specification is :ref:`optional | ||
#: <optionalhook>`. | ||
optionalhook: bool | ||
#: Whether to try to order this hook implementation :ref:`first | ||
#: <callorder>`. | ||
tryfirst: bool | ||
#: Whether to try to order this hook implementation :ref:`last | ||
#: <callorder>`. | ||
trylast: bool | ||
#: The name of the hook specification to match, see :ref:`specname`. | ||
specname: str | None |