Skip to content

Commit 6648199

Browse files
authored
Delete some unused code (#13276)
* Delete some unused code * lint
1 parent 3f33023 commit 6648199

File tree

4 files changed

+1
-29
lines changed

4 files changed

+1
-29
lines changed

mypy/checkstrformat.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -122,25 +122,6 @@ def compile_new_format_re(custom_spec: bool) -> Pattern[str]:
122122
FORMAT_RE_NEW_CUSTOM: Final = compile_new_format_re(True)
123123
DUMMY_FIELD_NAME: Final = "__dummy_name__"
124124

125-
# Format types supported by str.format() for builtin classes.
126-
SUPPORTED_TYPES_NEW: Final = {
127-
"b",
128-
"c",
129-
"d",
130-
"e",
131-
"E",
132-
"f",
133-
"F",
134-
"g",
135-
"G",
136-
"n",
137-
"o",
138-
"s",
139-
"x",
140-
"X",
141-
"%",
142-
}
143-
144125
# Types that require either int or float.
145126
NUMERIC_TYPES_OLD: Final = {"d", "i", "o", "u", "x", "X", "e", "E", "f", "F", "g", "G"}
146127
NUMERIC_TYPES_NEW: Final = {"b", "d", "o", "e", "E", "f", "F", "g", "G", "n", "x", "X", "%"}

mypy/errorcodes.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
These can be used for filtering specific errors.
44
"""
55

6-
from typing import Dict, List
6+
from typing import Dict
77

88
from typing_extensions import Final
99

10-
# All created error codes are implicitly stored in this list.
11-
all_error_codes: List["ErrorCode"] = []
12-
1310
error_codes: Dict[str, "ErrorCode"] = {}
1411

1512

mypy/message_registry.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,6 @@ def format(self, *args: object, **kwargs: object) -> "ErrorMessage":
141141
"Function {} could always be true in boolean context", code=codes.TRUTHY_BOOL
142142
)
143143
NOT_CALLABLE: Final = "{} not callable"
144-
PYTHON2_PRINT_FILE_TYPE: Final = (
145-
'Argument "file" to "print" has incompatible type "{}"; expected "{}"'
146-
)
147144
TYPE_MUST_BE_USED: Final = "Value of type {} must be used"
148145

149146
# Generic

mypy/messages.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -942,9 +942,6 @@ def does_not_return_value(self, callee_type: Optional[Type], context: Context) -
942942
else:
943943
self.fail("Function does not return a value", context, code=codes.FUNC_RETURNS_VALUE)
944944

945-
def underscore_function_call(self, context: Context) -> None:
946-
self.fail('Calling function named "_" is not allowed', context)
947-
948945
def deleted_as_rvalue(self, typ: DeletedType, context: Context) -> None:
949946
"""Report an error about using an deleted type as an rvalue."""
950947
if typ.source is None:

0 commit comments

Comments
 (0)