Skip to content

Support keyword-only parameters (*) #2

Description

@eallender

Description:
Add support for keyword-only parameters denoted by * in function signatures.

Example:

def foo(a, b, *, c, d):
    """
    Args:
        a (type): Description.
        b (type): Description.
        c (type): Description, keyword-only.
        d (type): Description, keyword-only.
    """

Implementation notes:

  • Tree-sitter node kind is keyword_separator
  • Parameters after * should be marked as keyword-only
  • Distinguish from *args (which is list_splat_pattern)
  • Update collect_args to track separator state
  • Update docstring format to indicate keyword-only status

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions