Pycodestyle complains when having two blank lines between imports and classes with a comment inbetween.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5.2k
- Forks
- 754
- PR merge metrics
- No merged PRs in 30d
Description
I use flake8 v3.3.0 which contains pycodestyle v2.3.1
This code fails:
import sys
# Some classes
class One:
pass
class Two:
pass
# Some other stuff
def foo():
print(sys.path)
If I add a blank line between the import statement and the comment, flake8 runs correctly but isort fails. See https://github.com/timothycrosley/isort/issues/550.
The isort maintainer means that isort is correct according to PEP8.
See also https://gitlab.com/pycqa/flake8/issues/336 where is said that this is a pycodestyle issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported snippet with pycodestyle 2.3.1 and compare its result with the PEP 8 interpretation described in the issue. Review the linked isort issue and flake8 issue for the expected handling of comments between imports and classes; done when the conflicting valid layout is consistently handled without introducing a regression.
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
- 45/100