Skip to content
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

Remove empty line before raw dostrings #7944

Closed
wants to merge 2 commits into from

Conversation

konstin
Copy link
Member

@konstin konstin commented Oct 13, 2023

Summary This fixes a deviation with black where black would remove empty lines before raw docstrings for some reason.

**Summary** This fixes a deviation with black where black would remove
empty lines before raw docstrings for some reason.
@konstin
Copy link
Member Author

konstin commented Oct 13, 2023

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Black treats this as "not a docstring" -- it does the same thing with non-triple-quoted strings in docstring positions, so e.g., it removes the newline here:

class C:

    "abc"

My opinion would be to keep our current behavior, because we do treat such non-triple-quoted strings as docstrings unlike Black, so treating the raw strings as docstrings is more internally consistent for us (and feels like a bug in Black).

@konstin
Copy link
Member Author

konstin commented Oct 16, 2023

Reported upstream: psf/black#3944

@konstin konstin closed this Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants