parser.add_argument(
"--stdout",
choices=("true", "false"),
default="true",
help="log data to stdout",
)
It also removed the superfluous spaces in the keyword arg assignments parser.add_argument(
"--stdout",
choices=("true", "false"),
default="true",
help="log data to stdout",
)
It also removed the superfluous spaces in the keyword arg assignmentsMy point stands - I do not think those spaces are superfluous. Consider the following:
a = 4
def foo(i: int):
return "A" * i
class Spam:
foo = 4
bar: int = 6
def eggs(self, n: int = 5):
return foo(i=n)
Why is it "i=n" instead of "i = n" when every other use of "=" has spaces?For this one case of a short function with simple names, okay, I don't always use spaces.
But otherwise I think the lack of spaces makes it the code harder to read, and thus "uglier".
The rest of us just follow the PEP8 style guide and move on
I think that rule is ugly. I explained why.
If you don't like the thread, move on.
Formatters _are_ a compromise. They make your coworkers' code nicer, and your code worse.
One, as I learned, could be resolved by a simple use of a terminal ",".
The other is how it removes spaces from around "=" for keyword arguments, but not for other uses of "=".
I can't provide much more as I rarely use black. As a single developer, I don't have to worry much about that sort of compromise. ;)
That I think it's wrong and ugly is an entirely different point.
PEP 8 specifically says it it not universal:
> Many projects have their own coding style guidelines. In the event of any conflicts, such project-specific guides take precedence for that project. ...
> However, know when to be inconsistent – sometimes style guide recommendations just aren’t applicable. When in doubt, use your best judgment. ...
> Some other good reasons to ignore a particular guideline:
> When applying the guideline would make the code less readable, even for someone who is used to reading code that follows this PEP.
I think always omitting spaces there makes it less readable, even for someone who is used to reading PEP 8.
That makes me more compliant to PEP 8 than black. ;)