Skip to content

docments(full=True) drops **kwargs docments unless args_kwargs=True is passed explicitly #909

Description

@civvic

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:

None

Expected result:

'keyword arguments'

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions