Skip to content

Commit 563d7b8

Browse files
committed
feat: type check alignment format specifiers
1 parent e37d92d commit 563d7b8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mypy/checkstrformat.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,14 @@ def conversion_type(
10731073
return UnionType(
10741074
[self.named_type("builtins.int"), self.named_type("builtins.str")]
10751075
)
1076+
elif p in ["<", ">", "=", "^"]:
1077+
return UnionType(
1078+
[
1079+
self.named_type("builtins.int"),
1080+
self.named_type("builtins.float"),
1081+
self.named_type("builtins.str")
1082+
]
1083+
)
10761084
else:
10771085
self.msg.unsupported_placeholder(p, context)
10781086
return None

0 commit comments

Comments
 (0)