-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
F: empty linesWasting vertical space efficiently.Wasting vertical space efficiently.S: acceptedThe changes in this design / enhancement issue have been accepted and can be implementedThe changes in this design / enhancement issue have been accepted and can be implementedT: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?
Description
Operating system: playground
Python version: playground
Black version: master
Consider following code snippet:
class X:
def f(self, x):
return x**2When class definition is formatted, empty lines between class X: line and first node of the body is forced to be zero.
When function definition is formatted, empty lines between def f(): line and first node of the body is normalised to either 0 (if input code had 0 empty lines) or 1 (if input code had 1+ empty lines).
While it's preferable to preserve some of the empty lines of input code, doing this for leading empty lines of node body makes no sense, as this empty line cannot have any mental meaning in such context.
dzhu, mermoldy, sadovnychyi, Zac-HD, aarchiba and 13 morebluenote10, return42, aneumann80, ricpark, naught101 and 3 more
Metadata
Metadata
Assignees
Labels
F: empty linesWasting vertical space efficiently.Wasting vertical space efficiently.S: acceptedThe changes in this design / enhancement issue have been accepted and can be implementedThe changes in this design / enhancement issue have been accepted and can be implementedT: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?