You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def h(x # type: xyz # type: ignore[foo] # E: Name "xyz" is not defined [name-defined] \
201
-
# N: Error code "name-defined" not covered by "type: ignore" comment ignoring [foo]
190
+
# N: Error code "name-defined" not covered by "type: ignore[foo]" comment
202
191
):
203
192
# type () -> None
204
193
pass
205
194
206
-
207
195
[case testErrorCodeIgnoreWithNote]
208
196
import nostub # type: ignore[import]
209
197
from defusedxml import xyz # type: ignore[import]
@@ -1026,30 +1014,24 @@ class D(TypedDict):
1026
1014
1027
1015
def f(d: D, s: str) -> None:
1028
1016
d[s] # type: ignore[xyz] # E: TypedDict key must be a string literal; expected one of ("x") [literal-required] \
1029
-
# N: Error code "literal-required" not covered by "type: ignore" comment ignoring [xyz]
1017
+
# N: Error code "literal-required" not covered by "type: ignore[xyz]" comment
1030
1018
d[s] # E: TypedDict key must be a string literal; expected one of ("x") [literal-required]
1031
1019
d[s] # type: ignore[misc] # E: TypedDict key must be a string literal; expected one of ("x") [literal-required] \
1032
1020
# N: Error code changed to literal-required; "type: ignore" comment may be out of date
1033
1021
d[s] # type: ignore[literal-required]
1034
-
1035
-
1036
-
1037
-
1038
1022
[builtins fixtures/dict.pyi]
1039
1023
[typing fixtures/typing-typeddict.pyi]
1040
1024
1041
1025
[case testRecommendErrorCode]
1042
1026
# type: ignore[whatever] # E: type ignore with error code is not supported for modules; use `# mypy: disable-error-code="whatever"` [syntax] \
1043
-
# N: Error code "syntax" not covered by "type: ignore" comment ignoring [whatever]
1027
+
# N: Error code "syntax" not covered by "type: ignore[whatever]" comment
1044
1028
1 + "asdf"
1045
1029
1046
-
1047
1030
[case testRecommendErrorCode2]
1048
1031
# type: ignore[whatever, other] # E: type ignore with error code is not supported for modules; use `# mypy: disable-error-code="whatever, other"` [syntax] \
1049
-
# N: Error code "syntax" not covered by "type: ignore" comment ignoring [whatever, other]
1032
+
# N: Error code "syntax" not covered by "type: ignore[whatever, other]" comment
1050
1033
1 + "asdf"
1051
1034
1052
-
1053
1035
[case testShowErrorCodesInConfig]
1054
1036
# flags: --config-file tmp/mypy.ini
1055
1037
# Test 'show_error_codes = True' in config doesn't raise an exception
0 commit comments