Skip to content

Improve function signatures to use positional-only, positional-or-keyword, or keyword-only parameter #2893

Open
@seisman

Description

@seisman

Previously mentioned in many places:

Related PEPs:

In short, the new function definition will be like:

def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):
      -----------    ----------     ----------
        |             |                  |
        |        Positional or keyword   |
        |                                - Keyword only
         -- Positional only

Note: Enable ruff's flake8-boolean-trap (FBT) after finishing this request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionsNeed more discussion before taking further actions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions