Skip to content

Contradicting requirements in collections.abc.Sequence docs and typing information #132292

@502E532E

Description

@502E532E

Documentation

The collections.abc.Sequence docs state that __getitem__ needs to be implemented, and link to some general __getitem__ docs. It states

For sequence types, the accepted keys should be integers. Optionally, they may support slice objects as well.

But the corresponding typing information requires slice support.

To resolve this, either the docs or the typing information should be adapted.

Related

#120802 (general __getitem__ docs improvements)
My corresponding question and answer on Stackoverflow

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions