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

Format nested string quotes #2827

Closed
TomFryers opened this issue Jan 29, 2022 · 1 comment
Closed

Format nested string quotes #2827

TomFryers opened this issue Jan 29, 2022 · 1 comment
Labels
R: duplicate This issue or pull request already exists T: enhancement New feature or request

Comments

@TomFryers
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Currently, Black (even with --preview) won’t do anything to the following code

f'N is {things["N"]}'
f"N is {things['N']}"

Describe the solution you'd like

It would be nice to be able to format these two expressions in the same way.

Describe alternatives you've considered

The obvious question is which one to choose, but I think it’s clear that the latter is more natural considering Black’s current style.

Additional context

  • Perhaps this should be under --preview.
  • Triple-quoted strings have a similar problem, but they are much rarer.
@TomFryers TomFryers added the T: enhancement New feature or request label Jan 29, 2022
@JelleZijlstra
Copy link
Collaborator

Duplicate of #567

@JelleZijlstra JelleZijlstra marked this as a duplicate of #567 Jan 29, 2022
@ichard26 ichard26 added the R: duplicate This issue or pull request already exists label Jan 29, 2022
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: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants