You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PEP8
I also refer you to PEP8 blank lines conventions, where the following is mentioned: Method definitions inside a class are surrounded by a single blank line.
Having this in mind, I'm pretty sure you should rethink not having a single blank line when class doc string is not present.
On blackmain page, you mention: Black is a PEP 8 compliant opinionated formatter with its own style.
And at the second page you mention: The coding style used by Black can be viewed as a strict subset of PEP 8.
I am sure you mention following PEP8 guidance multiple more times at the docs.
If Black's coding style can be viewed as a strict subset of PEP 8, then why does it contradict PEP8 standards?
Quote: Method definitions inside a class are surrounded by a single blank line.
If you don't think this change is required, why not change the docs to make them more truthy and don't pretend black completely follows PEP and can be viewed as a strict subset of PEP 8?
For what it's worth, to me the rationale is similar to not having blank lines before the first line of a file if it's a def or class, even though PEP 8 says to "surround defs and classes with two blank lines".
Always have a blank line between class declaration and first inner method.
How I would like the code to look after
black
formatting:Code after
black
current formatting:PEP8
I also refer you to PEP8 blank lines conventions, where the following is mentioned:
Method definitions inside a class are surrounded by a single blank line.
Having this in mind, I'm pretty sure you should rethink not having a single blank line when class doc string is not present.
Screenshot examples
With blank line: https://telegra.ph/file/04d880862ac743cb9fe3b.png
Without blank line: https://telegra.ph/file/0a603992a333412b0fa81.png
IMO, first option is much cleaner + easier to read when you have a lot of methods + follow PEP8.
I think this should be enough to at least think once more about having one blank line after class definition.
Additional context
This is a duplicated issue from Issue #619.
The text was updated successfully, but these errors were encountered: