flake8-pie
flake8-pie copied to clipboard
add rule `foo[0:bar]` can be rewritten as `foo[:bar]`
maybe there's an edge case when someone overloads this? not sure
This isn't really safe without type information:
class Foo:
def __getitem__(self, key):
print(key)
Foo()[:10]
# slice(None, 10, None)
Foo()[0:10]
# slice(0, 10, None)