docments(..., full=True) does not retain a trailing docment attached to **kwargs.
This contradicts the documentation in 04_docments.ipynb, which says that args_kwargs=True is always enabled when full=True:
... (Note that for full, args_kwargs=True is always set too.)
Reproduction
from fastcore.docments import docments
def f(
**kwargs, # keyword arguments
): pass
docments(f, full=True)['kwargs']['docment']
Actual result:
Expected result:
Passing args_kwargs=True explicitly produces the expected result:
docments(f, full=True, args_kwargs=True)['kwargs']['docment']
# 'keyword arguments'
Environment
- fastcore: 2.2.13
- Branch:
main
Likely cause
docments() passes args_kwargs unchanged to _param_locs(), even when full=True:
p = _param_locs(s, returns=returns, args_kwargs=args_kwargs) or {}
This appears inconsistent with the documented behavior that full docments include variadic parameter docments.
A possible fix is to make full=True imply args_kwargs=True.
docments(..., full=True)does not retain a trailing docment attached to**kwargs.This contradicts the documentation in
04_docments.ipynb, which says thatargs_kwargs=Trueis always enabled whenfull=True:Reproduction
Actual result:
NoneExpected result:
'keyword arguments'Passing
args_kwargs=Trueexplicitly produces the expected result:Environment
mainLikely cause
docments()passesargs_kwargsunchanged to_param_locs(), even whenfull=True:This appears inconsistent with the documented behavior that full docments include variadic parameter docments.
A possible fix is to make
full=Trueimplyargs_kwargs=True.