PyCQA / PyCQA/pycodestyle

False negative for extraneous whitespace around colon

Open
#321 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Python
Stars
5.2k
Forks
754
PR merge metrics
No merged PRs in 30d

Description

@anthonymayer reported this in hhatto/autopep8#156.

example.py:

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

I would expect a message about extraneous whitespace after the colon, but pep8 seems to report nothing.

$ pep8 --version
1.5.7
$ pep8 example.py

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report using the example.py snippet and the pep8 command shown in the issue. Trace the checker entry point for slice expressions and add coverage so extraneous whitespace after the colon is reported, then verify the example produces that diagnostic.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.