Skip to content

Automatic concatenation of f-strings not working properly #592

@servadestroya

Description

@servadestroya

With vanilla python, contiguous string literals concatenate automatically, which is useful for breaking long literal strings into multiple lines. This functionality is preserved in coconut for normal strings, but with f-strings the transpiler produces code that uses the .format method, breaking this functionality.

# Regular strings
"hello ""there"

# F-strings
f"hello "f"there"

Results with python:
image

Results with coconut:
image

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions