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

Formatter: try-except-else comment switches body #5675

Closed
Tracked by #6069
konstin opened this issue Jul 11, 2023 · 2 comments
Closed
Tracked by #6069

Formatter: try-except-else comment switches body #5675

konstin opened this issue Jul 11, 2023 · 2 comments
Labels
bug Something isn't working formatter Related to the formatter

Comments

@konstin
Copy link
Member

konstin commented Jul 11, 2023

We format

try:
    pass
except X:
    pass
else:
    # comment
    print()

as

try:
    pass
except X:
    pass
    # comment
else:
    print()

even though the comment should rather remain a leading comment of the print statement

@konstin konstin added the formatter Related to the formatter label Jul 11, 2023
@MichaReiser MichaReiser added the bug Something isn't working label Jul 11, 2023
@charliermarsh
Copy link
Member

@konstin - I can't reproduce this, maybe it was fixed between now and then?

@charliermarsh
Copy link
Member

(Preemptively closing.)

@MichaReiser MichaReiser added this to the Formatter: Alpha milestone Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working formatter Related to the formatter
Projects
None yet
Development

No branches or pull requests

3 participants