Skip to content

Clarification on signature for index #152030

Description

@lgalfaso

Documentation

The documentation reads that the signature for index (sequences, str, bytes) is .index(value[, start[, end]]), (the name of the first parameter changes depending on the underlying type). This leaves it open to interpretation whether any/all the parameters can be named parameters (that they cannot). Should the signature of these methods be .index(sub[, start[, end]], /)?

Ref: https://docs.python.org/3/library/stdtypes.html#sequence.index

Note: Tried looking whether there is some convention that specifies that if there are optional parameters in brackets, this means that the parameters are positional only, but was unable to find anything.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions