Skip to content

Forbid explicit step in slice #1071

Description

@orsinium

Rule request

Thesis

# bad
a[1:4:]
# good
a[1:4]

# bad
a[1::]
# good
a[1:]

# bad
a[1:4:1]
# good
a[1:4]

# bad
a[1::1]
# good
a[1:]

# bad
a[::1]
# good
a.copy()

Case with a[::] will be covered in #1011

Reasoning

Consistency

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions