3 ms·
"black can kick and scream and its proponent can say that the frowny face is all they need but they are wrong. They are wrong visually, and they are wrong accor
by benatkin 7y ago
"black can kick and scream and its proponent can say that the frowny face is all they need but they are wrong. They are wrong visually, and they are wrong according to pep8. End of story."
The "frowny face" is ): which in Python is all over the place, but hopefully you don't notice it, and if you do, you don't care.
I find it to be sufficient separation between the arguments and the code. It's too bad the author doesn't, but that doesn't change it for me or other devs that are comfortable with it.
This:
def very_important_function(
template: str,
*variables,
file: os.PathLike,
engine: str,
header: bool = True,
debug: bool = False,
):
"""Applies `variables` to the `template` and writes to `file`."""
with open(file, "w") as f:
is similar to this, which has caught on in React with Prettier:
<select
value={fruit}
onChange={({target: {value}}) => setFruit(value)}
>
<option value="apple">Apple</option>
<option value="orange">Orange</option>
<option value="banana">Banana</option>
</select>
The fact that people like it in multiple languages means it's definitely an uphill battle to go back to indenting it further.
- fastball 7y agoThe current project I'm working on is Python+Black for backend and React+Prettier for frontend and I've really enjoyed the consistency / not worrying about formatting.