Remove newlines after def
#3033
Labels
F: empty lines
Wasting vertical space efficiently.
T: style
What do we want Blackened code to look like?
TL;DR
There shouldn't be a newline right after
def
statement.Describe the style change
Newlines are great. They help us organize our code and leave room for the coders and reviewers to breath.
However, too many newlines can make simple code gigantic and massive. This is unnecessary in a lot of cases.
I want to argue that having a newline right after
def
is redundant and Black should remove itExamples in the current Black style
Right now Black won't change the following code:
Desired style
Black should change the code above to:
What about classes?
I think that the issue above is not relevant to classes.
A new line after a
class
definition makes sense to me, since there is no actual meaning for the methods definitions order.The newline after
class
definition makes room for the reader to breath before diving in to each method of the class.So, Black should not change the following code:
The text was updated successfully, but these errors were encountered: