-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
T: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?
Description
Describe the style change
Currently, black preserves the blank line before regular doc strings, but not before raw docstrings. It should preserve them before both.
Input
class TextIOWrapper(TextIOBase):
r"""Character and line based layer over a BufferedIOBase object, buffer.
[...]
"""
_CHUNK_SIZE = 2048
class TextIOWrapper(TextIOBase):
"""Character and line based layer over a BufferedIOBase object, buffer.
[...]
"""
_CHUNK_SIZE = 2048
Examples in the current Black style
class TextIOWrapper(TextIOBase):
r"""Character and line based layer over a BufferedIOBase object, buffer.
[...]
"""
_CHUNK_SIZE = 2048
class TextIOWrapper(TextIOBase):
"""Character and line based layer over a BufferedIOBase object, buffer.
[...]
"""
_CHUNK_SIZE = 2048
Desired style
class TextIOWrapper(TextIOBase):
r"""Character and line based layer over a BufferedIOBase object, buffer.
[...]
"""
_CHUNK_SIZE = 2048
class TextIOWrapper(TextIOBase):
"""Character and line based layer over a BufferedIOBase object, buffer.
[...]
"""
_CHUNK_SIZE = 2048
Additional context
Currently, black doesn't seem to consider raw triple quotes strings as docstrings, even though cpython (and PEP 257) do. I've seen some raw triple quoted doc string uses in the wild, such as the above example from cpython.
Metadata
Metadata
Assignees
Labels
T: styleWhat do we want Blackened code to look like?What do we want Blackened code to look like?