-
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.R: rejectedThis will not be worked onThis will not be worked onS: needs discussionNeeds further hashing out before ready for implementation (on desirability, feasibility, etc.)Needs further hashing out before ready for implementation (on desirability, feasibility, etc.)T: bugSomething isn't workingSomething isn't working
Description
Can Black have a rule to not remove the whitespace at line 2 from here:
class C:
def __init__(self):
passso that it will keep the blank line between class definition and any first inner entity (as it does already with the docstrings and assignment attributes)?
It's extremely ugly to have that whitespace consistent in the entire codebase and just in this particular situation, where you don't have anything to add between class definition and the first inner method (which usually is the __init__ one), to end up with "glued" headers of class and method definition.
Now if I'm formatting this:
class C:
def __init__(self):
pass
def func(self):
passI get this:
class C:
def __init__(self):
pass
def func(self):
passSo I expect the rule of one empty line before and after class methods to be consistent here. Everyone likes to have symmetry in their code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
F: empty linesWasting vertical space efficiently.Wasting vertical space efficiently.R: rejectedThis will not be worked onThis will not be worked onS: needs discussionNeeds further hashing out before ready for implementation (on desirability, feasibility, etc.)Needs further hashing out before ready for implementation (on desirability, feasibility, etc.)T: bugSomething isn't workingSomething isn't working