We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fa153c commit bda3dc1Copy full SHA for bda3dc1
1 file changed
mypy/checkstrformat.py
@@ -391,7 +391,8 @@ def inline_semi_dynamic_specs(
391
) # dynamic spec cannot be last, this should have been detected earlier
392
393
if isinstance(next_expression, StrExpr): # now inline the literal
394
- parsed = parse_format_value(f"{{:{next_expression.value}}}", call, self.msg)
+ new_format_string = f"{{{spec.conversion or ''}:{next_expression.value}}}"
395
+ parsed = parse_format_value(new_format_string, call, self.msg)
396
if parsed is None or len(parsed) != 1:
397
continue
398
spec = parsed[0]
0 commit comments