Commit 3937bfcc authored by Stefan Behnel's avatar Stefan Behnel

use string concatenation instead of string joining for 2-item f-strings

parent 5cf45fab
...@@ -3969,6 +3969,9 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations): ...@@ -3969,6 +3969,9 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
node = ExprNodes.UnicodeNode(node.pos, value=EncodedString('')) node = ExprNodes.UnicodeNode(node.pos, value=EncodedString(''))
elif len(values) == 1: elif len(values) == 1:
node = values[0] node = values[0]
elif len(values) == 2:
# reduce to string concatenation
node = ExprNodes.binop_node(node.pos, '+', *values)
else: else:
node.values = values node.values = values
return node return node
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment