Skip to content

Convert concat to f-string #196

@pyr0ball

Description

@pyr0ball

For a variety of reasons, when working with strings in Python, it's far better to use the print(f) function than to concatenate, including readability and execution optimization. Concatenation creates a copy of the string in memory for each new token, while the print(f) function avoids doing this.

An example:
image

I'll be working through code and replacing these snips whenever I find them. Please reference this issue in your commits if you push any changes related to converting concats to print(f)

Metadata

Metadata

Assignees

Labels

optimizationcode/data-level enhancements

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions