Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Priority of breaking subscripts vs breaking previous elements #1406

Closed
dhalbert opened this issue May 11, 2020 · 2 comments
Closed

Priority of breaking subscripts vs breaking previous elements #1406

dhalbert opened this issue May 11, 2020 · 2 comments
Labels
R: duplicate This issue or pull request already exists T: style What do we want Blackened code to look like?

Comments

@dhalbert
Copy link

Describe the style change A subscript at the end of a long line of parenthesized elements gets broken in an odd way. The length must be just slightly over the line length.

Examples in the current Black style

The length is crucial. The last element must be, e.g., 12345 or 123456 to make this happen

a = (123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 12345)[
    0
]

Desired style
(A last element of 1234567 would generate something like this, so it's an edge case.)

a = (
    123,
    123,
    123,
    123,
    123,
    123,
    123,
    123,
    123,
    123,
    123,
    123,
    123,
    123,
    123,
    12345,
)[0]

This is not terrible, but I was just startled by it when I saw it.

@dhalbert dhalbert added the T: style What do we want Blackened code to look like? label May 11, 2020
@graingert
Copy link
Contributor

there seems to be a few duplicates of this:

#814
#1101
#1406

@ichard26 ichard26 added the R: duplicate This issue or pull request already exists label Nov 25, 2020
@ichard26
Copy link
Collaborator

Indeed this is a duplicate of #814. Thanks for the formatting suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R: duplicate This issue or pull request already exists T: style What do we want Blackened code to look like?
Projects
None yet
Development

No branches or pull requests

3 participants