PEP8 E226 recommendation

0 votes
The E226 error code is about "missing whitespace around arithmetic operator".

I use Anaconda's package in Sublime which will highlight as a PEP8 E226 violation for example this line:

hypot2 = x*x + y*y
But in Guido's PEP8 style guide that line is actually shown as an example of recommended use of spaces within operators.

So, which is the correct guideline? Always spaces around operators or just in some cases?

Also, who decides what goes into PEP8? I would've thought Guido's recommendation would pretty much determine how that works.
May 23 in Python by ana1504.k
• 7,890 points
43 views

1 answer to this question.

0 votes
The maintainers of the PEP8 tool decide what goes into it.

As you noticed, these do not always match the PEP8 style guide exactly. In this particular case, I don't know whether it's an oversite by the maintainers, or a deliberate decision. You'd have to ask them to find out, or you might find the answer in the commit history.

Guido recently asked the maintainers of pep8 and pep257 tools to rename them, to avoid this confusion.
answered May 23 by SDeb
• 13,210 points

Related Questions In Python

+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 416 views
0 votes
1 answer

PEP8 space after a comma

I guess the reason that most people ...READ MORE

answered Jul 19 in Python by SDeb
• 13,210 points
102 views