Don't split type annotation with alternative union syntax #2038
Labels
F: linebreak
How should we split up lines?
R: duplicate
This issue or pull request already exists
S: accepted
The changes in this design / enhancement issue have been accepted and can be implemented
T: style
What do we want Blackened code to look like?
Describe the style change
With postponed evaluations of type annotations it's now possible to write a
Union
asint | None
. With black20.8b1
this can sometimes be formatted in a misleading way.Examples in the current Black style
Desired style
Additional context
With
from __future__ import annotations
, this syntax is valid in Python 3.7+https://www.python.org/dev/peps/pep-0604/
The text was updated successfully, but these errors were encountered: