-
-
Notifications
You must be signed in to change notification settings - Fork 654
some fixes for pycodestyle E275 #35687
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
Conversation
@@ -400,10 +400,10 @@ def some_elements(self): | |||
points = [] | |||
R = self.base_ring() | |||
for i in range(self.ambient_dim() + 5): | |||
points.append([R(i*j^2) for j in range(self.ambient_dim())]) | |||
points.append([R(i * j ^ 2) for j in range(self.ambient_dim())]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This spacing is a bit much for my taste. Wouldn't i * j^2
conform to the spec too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid not. Also, I am not sure if XOR is really the intended thing here. changing it to **
breaks some doctests though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right, this is XOR there. So spacing that agrees with precedence would be i*j ^ 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This expression has been there since the very beginning; 7e02dce)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://peps.python.org/pep-0008/#other-recommendations
"If operators with different priorities are used, consider adding whitespace around the operators with the lowest priority(ies)."
# Correct:
[...]
x = x*2 - 1
hypot2 = x*x + y*y
c = (a+b) * (a-b)
# Wrong:
[...]
x = x * 2 - 1
hypot2 = x * x + y * y
c = (a + b) * (a - b)
voilà |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, looking good.
Documentation preview for this PR (built with commit ded1602) is ready! 🎉 |
📚 Description
This fixes some E275 warnings (E275 missing whitespace after keyword) plus a few other things
outside of
graphs
,rings
,misc
,coding
andcombinat
for now📝 Checklist
⌛ Dependencies