Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whitespace before ':' (E203) should not apply to slices #36

Closed
FabianNiehaus opened this issue Jan 14, 2021 · 1 comment
Closed

Whitespace before ':' (E203) should not apply to slices #36

FabianNiehaus opened this issue Jan 14, 2021 · 1 comment

Comments

@FabianNiehaus
Copy link

When definining a string slice like this:

my_string[my_string.rindex("/") + 1 : my_string.index(":")]

flake8 will raise violation E203.

However, this should not apply to slices, as mentioned in https://www.python.org/dev/peps/pep-0008/#pet-peeves.

Manually removing the spaces does not work in our case, as code formatting is done by black, which will automatically add whitepspaces around : when used in a slice.

@FabianNiehaus
Copy link
Author

Opened this issue in the wrong repo, reposted it on the pycodestyle repo: PyCQA/pycodestyle#373 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant