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
• 6,670 points
11 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 10,780 points

Related Questions In Python

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.