Why the Sad Face?
lukasz.langa.pl
lukasz.langa.pl
Not to me! I love it and was doing it before I discovered Black and am immensely grateful for just about every formatting decision that Black makes (except sometimes I wish lists of function parameters didn't get split out one per line as soon as they run longer than a line, but that's extremely minor and I agree with why Black does it). In general Black's format rules just make sense where so many others (like pep8's 79 character line) do not.
Often asking an organization to dictate a coding style guide is like pulling teeth (painful), but I've never had any challenges when proposing Black because it works in a way that makes life nicer for literally everyone and justifies each of its actions with a really good reason.
def f(x):
Pass # visually inside
def f(
X # visually inside
): # visually outside of function
passI think also that the comments you put there are mistaken because functions have more logical sections than you're recognizing here. Function definitions always follow the form `<label>(<arguments>): <body>`. You say "visually inside" in two of your comments, but in actuality they are two different things entirely because one is talking about the body section and one is talking about the arguments section, and your first example just skips over the arguments section as if it either doesn't exist or isn't its own very important part of the function definition.
A more thorough example set without yet expanding the arguments would be:
def f(x # inside of arguments section): # outside of arguments section
Pass # inside of body section
vs def f(
X # inside of arguments section
): # outside of arguments section
pass # inside of body section
or if one prefers to make the "outside" parts nonexplicit, def f(x # inside of arguments section):
Pass # inside of body section
vs def f(
X # inside of arguments section
):
pass # inside of body section
The indent+dedent says "this is the section". But again, Black only does anything if your argument section runs longer than a single line.It's really not about def f(x), because Black does exactly the thing you want for f(x). It's about
def f(abesessefe, dedddf_asdf, readfsefsef_afsefse, foreard_aree_aers=True,
arese_mars_mares=None, maresd_des_reeebo='17'):
pass
vs def f(
| abesessefe,
| dedddf_asdf,
| readfsefsef_afsefse,
| foreard_aree_aers=True,
| arese_mars_mares=None,
| maresd_des_reeebo='17'
):
pass
The point of what Black does is that in the second case the dedented section terminator `)` is always going to be at the same column as the def if the arguments run past one line, so it will always be easy to find and your arguments will also be a lot easier to read.Then again this is not the hill I choose to die on.