File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,9 @@ def locate(path: str) -> Optional[object]:
73
73
74
74
75
75
class Hook (Generic [T ]):
76
+ """
77
+ Holds a single hook function and its options dictionary
78
+ """
76
79
77
80
def __init__ (self ) -> None :
78
81
self .func = None # type: T
@@ -87,6 +90,9 @@ def __ne__(self, other: object) -> bool:
87
90
def __repr__ (self ) -> str :
88
91
return 'Hook({}, {})' .format (self .func , self .options )
89
92
93
+ def __bool__ (self ) -> bool :
94
+ return self .func is not None
95
+
90
96
91
97
# The docstring_parser hook is called for each unannotated function that has a
92
98
# docstring. The callable should accept four arguments:
@@ -108,6 +114,10 @@ def __repr__(self) -> str:
108
114
109
115
110
116
class Hooks :
117
+ """
118
+ Holds all known hooks
119
+ """
120
+
111
121
def __init__ (self ) -> None :
112
122
self .docstring_parser = DocstringParserHook ()
113
123
You can’t perform that action at this time.
0 commit comments