[docs] [issue16239] PEP8 arithmetic operator examples

Peter Würtz report at bugs.python.org
Mon Oct 15 14:55:38 CEST 2012

New submission from Peter Würtz:

I think the PEP8 examples for arithmetic expressions are a bit misleading. (http://www.python.org/dev/peps/pep-0008/#id20)

The text clearly says that it should add spaces around operators of low(est) priority, which means that I'm encouraged to visually group an expression of high priority. It doesn't say (anymore?) that there should always be spaces around all arithmetic operators.

This is however not reflected in the examples. In the examples
"x = x*2 - 1" is listed as a negative example, while being perfectly compliant with the guide. Shouldn't this be in the "Yes" or an "Optionally" example block?

I believe these examples may cause some people to interpret the style guide in a very rigid way, eventually leading to PEP8 formatting tools that flatten out nicely grouped expressions.

assignee: docs at python
components: Documentation
messages: 172965
nosy: docs at python, pwuertz
priority: normal
severity: normal
status: open
title: PEP8 arithmetic operator examples
type: enhancement

Python tracker <report at bugs.python.org>

More information about the docs mailing list