mirror of
https://github.com/micropython/micropython.git
synced 2025-09-07 10:20:52 +02:00
This improves the TOC display of the generated differences section. Signed-off-by: Jeff Epler <jepler@gmail.com>
15 lines
435 B
Python
15 lines
435 B
Python
"""
|
|
categories: Core,f-strings
|
|
description: f-strings don't support concatenation with adjacent literals if the adjacent literals contain braces
|
|
cause: MicroPython is optimised for code space.
|
|
workaround: Use the + operator between literal strings when they are not both f-strings
|
|
"""
|
|
|
|
x, y = 1, 2
|
|
# fmt: off
|
|
print("aa" f"{x}") # works
|
|
print(f"{x}" "ab") # works
|
|
print("a{}a" f"{x}") # fails
|
|
print(f"{x}" "a{}b") # fails
|
|
# fmt: on
|