@@ -245,7 +245,7 @@ def wrapper(*args, **kwargs) -> Callable[..., Any]:
245
245
return decorate
246
246
247
247
248
- def doc (* args : Union [str , Callable ], ** kwargs : str ) -> Callable [[F ], F ]:
248
+ def doc (* supplements : Union [str , Callable ], ** substitutes : str ) -> Callable [[F ], F ]:
249
249
"""
250
250
A decorator take docstring templates, concatenate them and perform string
251
251
substitution on it.
@@ -258,10 +258,10 @@ def doc(*args: Union[str, Callable], **kwargs: str) -> Callable[[F], F]:
258
258
259
259
Parameters
260
260
----------
261
- *args : str or callable
261
+ *supplements : str or callable
262
262
The string / docstring / docstring template to be appended in order
263
263
after default docstring under callable.
264
- **kwags : str
264
+ **substitutes : str
265
265
The string which would be used to format docstring template.
266
266
"""
267
267
@@ -271,18 +271,18 @@ def decorator(call: F) -> F:
271
271
if call .__doc__ :
272
272
docstring_components .append (dedent (call .__doc__ ))
273
273
274
- for appender in args :
275
- if hasattr (appender , "_docstring_components" ):
274
+ for supplement in supplements :
275
+ if hasattr (supplement , "_docstring_components" ):
276
276
docstring_components .extend (
277
- appender ._docstring_components # type: ignore
277
+ supplement ._docstring_components # type: ignore
278
278
)
279
- elif isinstance (appender , str ) or appender .__doc__ :
280
- docstring_components .append (appender )
279
+ elif isinstance (supplement , str ) or supplement .__doc__ :
280
+ docstring_components .append (supplement )
281
281
282
282
# formatting templates and concatenating docstring
283
283
call .__doc__ = "" .join (
284
284
[
285
- component .format (** kwargs )
285
+ component .format (** substitutes )
286
286
if isinstance (component , str )
287
287
else dedent (component .__doc__ or "" )
288
288
for component in docstring_components
0 commit comments