Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#3926·black

Long string in return annotation does not get split if there's parameters

Author: jakkdlCreated Oct 6, 2023Updated Sep 13, 2026
LabelsT: bugF: linetoolong

Describe the bug This was first reported in #2699, and thought resolved in #2990, except that only solved the specific case of the function having no parameters.

To Reproduce Run the test return_annotation_brackets_string:

https://github.com/psf/black/blob/3a2d76c7bcf39e852f3b379b76537d7847ed4225/tests/data/preview/return_annotation_brackets_string.py#L1-L23

The second function should be formatted exactly the same as the first one.

Source: psf/black

View original on GitHubView discussion on GitHub