Returns a tuple of check functions that check whether, respectively, a node or a type is compatible with a star in a conversion specifier.
(self, context: Context)
| 898 | return checkers |
| 899 | |
| 900 | def checkers_for_star(self, context: Context) -> Checkers: |
| 901 | """Returns a tuple of check functions that check whether, respectively, |
| 902 | a node or a type is compatible with a star in a conversion specifier. |
| 903 | """ |
| 904 | expected = self.named_type("builtins.int") |
| 905 | |
| 906 | def check_type(type: Type) -> bool: |
| 907 | expected = self.named_type("builtins.int") |
| 908 | return self.chk.check_subtype( |
| 909 | type, expected, context, "* wants int", code=codes.STRING_FORMATTING |
| 910 | ) |
| 911 | |
| 912 | def check_expr(expr: Expression) -> None: |
| 913 | type = self.accept(expr, expected) |
| 914 | check_type(type) |
| 915 | |
| 916 | return check_expr, check_type |
| 917 | |
| 918 | def check_placeholder_type(self, typ: Type, expected_type: Type, context: Context) -> bool: |
| 919 | return self.chk.check_subtype( |
no test coverage detected