Commit eef6a2ba authored by Stefan Behnel's avatar Stefan Behnel

minor code cleanup

parent 6f6e1b10
...@@ -2967,18 +2967,17 @@ class JoinedStrNode(ExprNode): ...@@ -2967,18 +2967,17 @@ class JoinedStrNode(ExprNode):
# values [UnicodeNode|FormattedValueNode] Substrings of the f-string # values [UnicodeNode|FormattedValueNode] Substrings of the f-string
# #
type = py_object_type type = py_object_type
is_temp = True
subexprs = ['values'] subexprs = ['values']
def analyse_types(self, env): def analyse_types(self, env):
self.values = [v.analyse_types(env) for v in self.values] values = [v.analyse_types(env).coerce_to_pyobject(env) for v in self.values]
self.values = [v.coerce_to_pyobject(env) for v in self.values] if len(values) == 1:
self.is_temp = 1
if len(self.values) == 1:
# this is not uncommon because f-string format specs are parsed into JoinedStrNodes # this is not uncommon because f-string format specs are parsed into JoinedStrNodes
return self.values[0] return values[0]
else: self.values = values
return self return self
def generate_result_code(self, code): def generate_result_code(self, code):
list_var = Naming.quick_temp_cname list_var = Naming.quick_temp_cname
......
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