Skip to content

Support positional-only parameters (/) #1

Description

@eallender

Description:
Add support for Python 3.8+ positional-only parameters denoted by / in function signatures.

Example:

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

Implementation notes:

  • Tree-sitter node kind is positional_separator
  • Parameters before / should be marked as positional-only
  • Update collect_args to track separator state
  • Update docstring format to indicate positional-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