Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

"Class docstring should have 1 blank line around them" error when class has no implementation #8

Closed
dpursehouse opened this issue Jul 31, 2012 · 4 comments
Labels

Comments

@dpursehouse
Copy link
Contributor

Running pep257.py on the following module:

""" Test """


class MyException(Exception):

    """ My exception class. """

I get this error:

test.py:6:4: PEP257 Class docstring should have 1 blank line around them

The error is not shown if the code is changed to:

""" Test """


class MyException(Exception):

    """ Description of the error. """

    pass

Is this the expected behaviour? AFAIK the initial version is valid python code. It passes pep8 and pylint.

@keleshev
Copy link
Contributor

keleshev commented Aug 1, 2012

This is definitely an edge-case bug. There might be some other bugs for cases where class/function has empty body. I will look into that.

@bboe
Copy link
Contributor

bboe commented Jan 7, 2013

Any status update on this issue?

Edit: Took a look at the source and decided the fix was fairly simple. See PR #23

keleshev pushed a commit that referenced this issue Jan 11, 2013
Allow docstring only classes. Fixes issue #8.
@bboe
Copy link
Contributor

bboe commented Jan 12, 2013

This issue can probably be closed now.

@keleshev
Copy link
Contributor

Good point

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants