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

Didn't work implicit concat strings #169

Open
wimglenn opened this issue Mar 11, 2023 · 1 comment
Open

Didn't work implicit concat strings #169

wimglenn opened this issue Mar 11, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@wimglenn
Copy link

wimglenn commented Mar 11, 2023

Thanks for making this really helpful tool! I did find one problem:

Input:

d = "dog"
msg = (
    "The quick brown fox jumps over the lazy dog "
    "The quick brown fox jumps over the lazy {}".format(d)
)

Expected output:

d = "dog"
msg = (
    "The quick brown fox jumps over the lazy dog "
    f"The quick brown fox jumps over the lazy {d}"
)

Actual output:

Same as input - unchanged. Adding -tc -tj -a makes no difference.

@ikamensh
Copy link
Owner

Thanks for the report!

So before AST module started including start charno of nodes (<3.8), it was impractically difficult to code, so currently it explicitly prefers not to touch such code, as far as I remember. This might be reasonably easy to implement now.

However, this begs for bigger refactoring - using only AST for .format / % calls (which currently use custom state machine).

@ikamensh ikamensh added the enhancement New feature or request label Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants