"........................................................................... \\N{LAO KO LA}"
)
+msg = lambda x: f"this is a very very very long lambda value {x} that doesn't fit on a single line"
+
+dict_with_lambda_values = {
+ "join": lambda j: (
+ f"{j.__class__.__name__}({some_function_call(j.left)}, "
+ f"{some_function_call(j.right)})"
+ ),
+}
+
+# Complex string concatenations with a method call in the middle.
+code = (
+ (" return [\n")
+ + (
+ ", \n".join(
+ " (%r, self.%s, visitor.%s)"
+ % (attrname, attrname, visit_name)
+ for attrname, visit_name in names
+ )
+ )
+ + ("\n ]\n")
+)
+
+
+# Test case of an outer string' parens enclose an inner string's parens.
+call(body=("%s %s" % ((",".join(items)), suffix)))
+
# output
"A %s %s"
% ("formatted", "string"): (
"This is a really really really long string that has to go inside of a"
- " dictionary. It is %s bad (#%d)."
- )
- % ("soooo", 2),
+ " dictionary. It is %s bad (#%d)." % ("soooo", 2)
+ ),
}
D5 = { # Test for https://github.com/psf/black/issues/3261
"..........................................................................."
" \\N{LAO KO LA}"
)
+
+msg = (
+ lambda x: (
+ f"this is a very very very long lambda value {x} that doesn't fit on a single"
+ " line"
+ )
+)
+
+dict_with_lambda_values = {
+ "join": lambda j: (
+ f"{j.__class__.__name__}({some_function_call(j.left)}, "
+ f"{some_function_call(j.right)})"
+ ),
+}
+
+# Complex string concatenations with a method call in the middle.
+code = (
+ " return [\n"
+ + ", \n".join(
+ " (%r, self.%s, visitor.%s)" % (attrname, attrname, visit_name)
+ for attrname, visit_name in names
+ )
+ + "\n ]\n"
+)
+
+
+# Test case of an outer string' parens enclose an inner string's parens.
+call(body="%s %s" % (",".join(items), suffix))