Skip to content

Add notes about s[i] in Common Sequence Operations #134976

Closed
@Yzi-Li

Description

@Yzi-Li

Documentation

Operation Result Notes
s[i] ith item of s, origin 0 (3)
  1. If i or j is negative, the index is relative to the end of sequence s: len(s) + i or len(s) + j is substituted. But note that -0 is still 0.

We can add a note: If the sequence is empty or i is outside the sequence range, IndexError will be raised.

Linked PRs

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