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

Dismatch between autopep8 and pep8? #723

Open
xvectorizer opened this issue Jan 21, 2024 · 1 comment
Open

Dismatch between autopep8 and pep8? #723

xvectorizer opened this issue Jan 21, 2024 · 1 comment

Comments

@xvectorizer
Copy link

According to pep8, "However, in a slice the colon acts like a binary operator, and should have equal amounts on either side (treating it as the operator with the lowest priority). In an extended slice, both colons must have the same amount of spacing applied. Exception: when a slice parameter is omitted, the space is omitted:"

https://peps.python.org/pep-0008/#pet-peeves

However, autopep8 seems to format colon into something like: s[i: j] == s[j: 2 * j]. Based on pep8, I think it should be: s[i : j] == s[j : 2 * j].


Your Environment

  • Python version: Python 3.11.4
  • autopep8 version: autopep8 2.0.1 (pycodestyle: 2.10.0)
  • Platform: linux
@hhatto
Copy link
Owner

hhatto commented May 28, 2024

@xvectorizer

Thanks for reporing.
Could you please provide the specific code that is causing the issue?


Python Code

YOUR CODE

Command Line and Configuration

.pep8, setup.cfg, ...

[pep8]

Command Line

$ autopep8 

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

2 participants