-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
T: bugSomething isn't workingSomething isn't working
Description
Describe the bug
Black miscomputes the horizontal space required for lines containing the power operator ** with simple operands, and rewraps them much earlier than the expected 88-character line length. Perhaps that computation wasn’t adjusted for #538/#2726.
To Reproduce
Run Black with no arguments on this code (playground link):
x = 1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1
y = 1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1Black leaves the first line unaffected, but unexpectedly wraps the second vertically, even though its horizontal layout is only 56 characters long.
x = 1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1**1
y = (
1
** 1
** 1
** 1
** 1
** 1
** 1
** 1
** 1
** 1
** 1
** 1
** 1
** 1
** 1
** 1
** 1
** 1
)Expected behavior
Both lines should be unchanged.
Environment
- Black's version: 23.9.1
- OS and Python version: Linux/Python 3.10.12
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
T: bugSomething isn't workingSomething isn't working