[issue22316] Add rule about "extraneous whitespace around colon" to "Whitespace In Expressions and Statements" of PEP8

Anthony Mayer report at bugs.python.org
Sun Aug 31 18:02:43 CEST 2014


New submission from Anthony Mayer:

After discussion about extraneous whitespace around colons in a list slice not being an error on the pep8 checker project (see https://github.com/jcrocholl/pep8/issues/321#issuecomment-53649841), ncoghlan suggested filing a ticket here to get the issue added to PEP8. The issue being that PEP8 doesn't say that

x = [1, 2, 3, 4]
x[1: 3]

is wrong. It should suggest doing

x = [1, 2, 3, 4]
x[1:3]

instead. This rule should probably be added to the "Whitespace In Expressions and Statements" section of PEP8 (http://legacy.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements)

----------
assignee: docs at python
components: Documentation
messages: 226185
nosy: Guido.van.Rossum, anthonymayer, barry, docs at python, ncoghlan
priority: normal
severity: normal
status: open
title: Add rule about "extraneous whitespace around colon" to "Whitespace In Expressions and Statements" of PEP8

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22316>
_______________________________________


More information about the Python-bugs-list mailing list