-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest black (25.1.0) adds a newline after docstring and before pass in an exception class #4571
Comments
This is correct and expected. Black 25 releases our new stable style for 2025, and one of the thing it changes is a bugfix where we were previously failing to recognize strings like this one as docstrings. We previously already behaved this way for triple-quoted docstrings; now the behavior is consistent.
If you don't want the blank line, I'd recommend removing the |
Thanks for the explanation, that makes sense - I'll re-train myself not to use |
This file:
When run through the latest Black is reformatted to look like this:
Here's a way to see that happen using
uvx
. With the previous Black version:This outputs:
But if you bump to
25.1.0
this happens:Output:
The text was updated successfully, but these errors were encountered: