black/tests/data/simple_cases/pep_604.py
Yilei "Dolee" Yang 01b8d3d409
Do not add trailing commas to return type annotations using PEP 604 unions (#3735)
Fix #3638: Do not add trailing commas to return type annotations using PEP 604 unions.
2023-06-15 17:08:26 -07:00

26 lines
583 B
Python

def some_very_long_name_function() -> my_module.Asdf | my_module.AnotherType | my_module.YetAnotherType | None:
pass
def some_very_long_name_function() -> my_module.Asdf | my_module.AnotherType | my_module.YetAnotherType | my_module.EvenMoreType | None:
pass
# output
def some_very_long_name_function() -> (
my_module.Asdf | my_module.AnotherType | my_module.YetAnotherType | None
):
pass
def some_very_long_name_function() -> (
my_module.Asdf
| my_module.AnotherType
| my_module.YetAnotherType
| my_module.EvenMoreType
| None
):
pass