@zzzen/pyright-internal 1.2.0-dev.20240908 → 1.2.0-dev.20240922

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/analyzer/analysis.d.ts +1 -0
  2. package/dist/analyzer/analysis.js +2 -0
  3. package/dist/analyzer/analysis.js.map +1 -1
  4. package/dist/analyzer/backgroundAnalysisProgram.js +6 -2
  5. package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -1
  6. package/dist/analyzer/cacheManager.d.ts +2 -2
  7. package/dist/analyzer/cacheManager.js.map +1 -1
  8. package/dist/analyzer/checker.js +31 -156
  9. package/dist/analyzer/checker.js.map +1 -1
  10. package/dist/analyzer/codeFlowEngine.js +21 -3
  11. package/dist/analyzer/codeFlowEngine.js.map +1 -1
  12. package/dist/analyzer/constraintSolver.d.ts +1 -2
  13. package/dist/analyzer/constraintSolver.js +5 -20
  14. package/dist/analyzer/constraintSolver.js.map +1 -1
  15. package/dist/analyzer/constraintTracker.d.ts +0 -4
  16. package/dist/analyzer/constraintTracker.js +0 -21
  17. package/dist/analyzer/constraintTracker.js.map +1 -1
  18. package/dist/analyzer/constructors.js +0 -1
  19. package/dist/analyzer/constructors.js.map +1 -1
  20. package/dist/analyzer/patternMatching.js +3 -1
  21. package/dist/analyzer/patternMatching.js.map +1 -1
  22. package/dist/analyzer/program.js +2 -3
  23. package/dist/analyzer/program.js.map +1 -1
  24. package/dist/analyzer/properties.js.map +1 -1
  25. package/dist/analyzer/protocols.d.ts +1 -2
  26. package/dist/analyzer/protocols.js +2 -2
  27. package/dist/analyzer/protocols.js.map +1 -1
  28. package/dist/analyzer/pythonPathUtils.d.ts +1 -1
  29. package/dist/analyzer/service.d.ts +2 -1
  30. package/dist/analyzer/service.js +56 -42
  31. package/dist/analyzer/service.js.map +1 -1
  32. package/dist/analyzer/sourceMapper.js +8 -4
  33. package/dist/analyzer/sourceMapper.js.map +1 -1
  34. package/dist/analyzer/tuples.d.ts +1 -2
  35. package/dist/analyzer/tuples.js.map +1 -1
  36. package/dist/analyzer/typeEvaluator.js +168 -108
  37. package/dist/analyzer/typeEvaluator.js.map +1 -1
  38. package/dist/analyzer/typeEvaluatorTypes.d.ts +27 -2
  39. package/dist/analyzer/typeEvaluatorTypes.js +62 -1
  40. package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
  41. package/dist/analyzer/typeGuards.d.ts +3 -12
  42. package/dist/analyzer/typeGuards.js +282 -456
  43. package/dist/analyzer/typeGuards.js.map +1 -1
  44. package/dist/analyzer/typePrinter.d.ts +1 -2
  45. package/dist/analyzer/typePrinter.js +4 -24
  46. package/dist/analyzer/typePrinter.js.map +1 -1
  47. package/dist/analyzer/typeStubWriter.js +12 -1
  48. package/dist/analyzer/typeStubWriter.js.map +1 -1
  49. package/dist/analyzer/typeUtils.d.ts +0 -17
  50. package/dist/analyzer/typeUtils.js +7 -59
  51. package/dist/analyzer/typeUtils.js.map +1 -1
  52. package/dist/analyzer/typedDicts.d.ts +1 -2
  53. package/dist/analyzer/typedDicts.js.map +1 -1
  54. package/dist/analyzer/types.d.ts +1 -0
  55. package/dist/analyzer/types.js +12 -0
  56. package/dist/analyzer/types.js.map +1 -1
  57. package/dist/backgroundAnalysisBase.d.ts +23 -16
  58. package/dist/backgroundAnalysisBase.js +65 -35
  59. package/dist/backgroundAnalysisBase.js.map +1 -1
  60. package/dist/backgroundThreadBase.js +9 -0
  61. package/dist/backgroundThreadBase.js.map +1 -1
  62. package/dist/common/commandLineOptions.d.ts +1 -0
  63. package/dist/common/commandLineOptions.js.map +1 -1
  64. package/dist/common/languageServerInterface.d.ts +1 -1
  65. package/dist/common/uri/uriUtils.d.ts +1 -1
  66. package/dist/common/uri/uriUtils.js +6 -1
  67. package/dist/common/uri/uriUtils.js.map +1 -1
  68. package/dist/languageServerBase.d.ts +2 -2
  69. package/dist/languageServerBase.js +1 -3
  70. package/dist/languageServerBase.js.map +1 -1
  71. package/dist/languageService/analyzerServiceExecutor.d.ts +6 -1
  72. package/dist/languageService/analyzerServiceExecutor.js +8 -7
  73. package/dist/languageService/analyzerServiceExecutor.js.map +1 -1
  74. package/dist/languageService/fileWatcherDynamicFeature.d.ts +5 -1
  75. package/dist/languageService/fileWatcherDynamicFeature.js +12 -2
  76. package/dist/languageService/fileWatcherDynamicFeature.js.map +1 -1
  77. package/dist/languageService/hoverProvider.d.ts +1 -1
  78. package/dist/languageService/hoverProvider.js +9 -10
  79. package/dist/languageService/hoverProvider.js.map +1 -1
  80. package/dist/localization/localize.d.ts +8 -0
  81. package/dist/localization/localize.js +2 -0
  82. package/dist/localization/localize.js.map +1 -1
  83. package/dist/localization/package.nls.cs.json +157 -153
  84. package/dist/localization/package.nls.de.json +130 -126
  85. package/dist/localization/package.nls.en-us.json +1632 -406
  86. package/dist/localization/package.nls.es.json +153 -149
  87. package/dist/localization/package.nls.fr.json +131 -127
  88. package/dist/localization/package.nls.it.json +145 -141
  89. package/dist/localization/package.nls.ja.json +144 -140
  90. package/dist/localization/package.nls.ko.json +157 -153
  91. package/dist/localization/package.nls.pl.json +180 -176
  92. package/dist/localization/package.nls.pt-br.json +141 -137
  93. package/dist/localization/package.nls.qps-ploc.json +394 -390
  94. package/dist/localization/package.nls.ru.json +172 -168
  95. package/dist/localization/package.nls.tr.json +155 -151
  96. package/dist/localization/package.nls.zh-cn.json +151 -147
  97. package/dist/localization/package.nls.zh-tw.json +135 -131
  98. package/dist/parser/unicode.js +136 -8
  99. package/dist/parser/unicode.js.map +1 -1
  100. package/dist/tests/checker.test.js +9 -0
  101. package/dist/tests/checker.test.js.map +1 -1
  102. package/dist/tests/config.test.js +40 -3
  103. package/dist/tests/config.test.js.map +1 -1
  104. package/dist/tests/envVarUtils.test.js +0 -3
  105. package/dist/tests/envVarUtils.test.js.map +1 -1
  106. package/dist/tests/harness/fourslash/testLanguageService.js +0 -3
  107. package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -1
  108. package/dist/tests/harness/fourslash/testState.js +2 -5
  109. package/dist/tests/harness/fourslash/testState.js.map +1 -1
  110. package/dist/tests/harness/fourslash/testStateUtils.d.ts +1 -0
  111. package/dist/tests/harness/fourslash/testStateUtils.js +5 -0
  112. package/dist/tests/harness/fourslash/testStateUtils.js.map +1 -1
  113. package/dist/tests/harness/vfs/filesystem.d.ts +3 -2
  114. package/dist/tests/harness/vfs/filesystem.js +6 -3
  115. package/dist/tests/harness/vfs/filesystem.js.map +1 -1
  116. package/dist/tests/service.test.js +31 -0
  117. package/dist/tests/service.test.js.map +1 -1
  118. package/dist/tests/typeEvaluator1.test.js +4 -0
  119. package/dist/tests/typeEvaluator1.test.js.map +1 -1
  120. package/dist/tests/typeEvaluator2.test.js +4 -0
  121. package/dist/tests/typeEvaluator2.test.js.map +1 -1
  122. package/dist/tests/typeEvaluator3.test.js +8 -0
  123. package/dist/tests/typeEvaluator3.test.js.map +1 -1
  124. package/dist/tests/typeEvaluator6.test.js +5 -1
  125. package/dist/tests/typeEvaluator6.test.js.map +1 -1
  126. package/dist/tests/typeEvaluator7.test.js +5 -1
  127. package/dist/tests/typeEvaluator7.test.js.map +1 -1
  128. package/dist/tests/typeEvaluator8.test.js +2 -2
  129. package/dist/workspaceFactory.d.ts +2 -20
  130. package/dist/workspaceFactory.js +20 -58
  131. package/dist/workspaceFactory.js.map +1 -1
  132. package/package.json +1 -1
@@ -1,7 +1,13 @@
1
1
  {
2
2
  "CodeAction": {
3
- "createTypeStub": "Create Type Stub",
4
- "createTypeStubFor": "Create Type Stub For \"{moduleName}\"",
3
+ "createTypeStub": {
4
+ "message": "Create Type Stub",
5
+ "comment": "{Locked='Stub'}"
6
+ },
7
+ "createTypeStubFor": {
8
+ "message": "Create Type Stub For \"{moduleName}\"",
9
+ "comment": "{Locked='Stub'}"
10
+ },
5
11
  "executingCommand": "Executing command",
6
12
  "filesToAnalyzeCount": "{count} files to analyze",
7
13
  "filesToAnalyzeOne": "1 file to analyze",
@@ -22,7 +28,10 @@
22
28
  "comment": "{Locked='Annotated'}"
23
29
  },
24
30
  "annotationBytesString": "Type expressions cannot use bytes string literals",
25
- "annotationFormatString": "Type expressions cannot use format string literals (f-strings)",
31
+ "annotationFormatString": {
32
+ "message": "Type expressions cannot use format string literals (f-strings)",
33
+ "comment": "'f-string' is the common English slang for a Python format string"
34
+ },
26
35
  "annotationNotSupported": "Type annotation not supported for this statement",
27
36
  "annotationRawString": "Type expressions cannot use raw string literals",
28
37
  "annotationSpansStrings": "Type expressions cannot span multiple string literals",
@@ -40,68 +49,170 @@
40
49
  "argPositionalExpectedOne": "Expected 1 positional argument",
41
50
  "argTypePartiallyUnknown": "Argument type is partially unknown",
42
51
  "argTypeUnknown": "Argument type is unknown",
43
- "assertAlwaysTrue": "Assert expression always evaluates to true",
44
- "assertTypeArgs": "\"assert_type\" expects two positional arguments",
45
- "assertTypeTypeMismatch": "\"assert_type\" mismatch: expected \"{expected}\" but received \"{received}\"",
46
- "assignmentExprComprehension": "Assignment expression target \"{name}\" cannot use same name as comprehension for target",
52
+ "assertAlwaysTrue": {
53
+ "message": "Assert expression always evaluates to true",
54
+ "comment": "{Locked='true'}"
55
+ },
56
+ "assertTypeArgs": {
57
+ "message": "\"assert_type\" expects two positional arguments",
58
+ "comment": "{Locked='assert_type'}"
59
+ },
60
+ "assertTypeTypeMismatch": {
61
+ "message": "\"assert_type\" mismatch: expected \"{expected}\" but received \"{received}\"",
62
+ "comment": "{Locked='assert_type'}"
63
+ },
64
+ "assignmentExprComprehension": {
65
+ "message": "Assignment expression target \"{name}\" cannot use same name as comprehension for target",
66
+ "comment": "A comprehension is a 'set of looping and filtering instructions' applied to a collection to generate a new collection; the word may not be translatable"
67
+ },
47
68
  "assignmentExprContext": "Assignment expression must be within module, function or lambda",
48
69
  "assignmentExprInSubscript": "Assignment expressions within a subscript are supported only in Python 3.10 and newer",
49
- "assignmentInProtocol": "Instance or class variables within a Protocol class must be explicitly declared within the class body",
70
+ "assignmentInProtocol": {
71
+ "message": "Instance or class variables within a Protocol class must be explicitly declared within the class body",
72
+ "comment": "{Locked='Protocol'}"
73
+ },
50
74
  "assignmentTargetExpr": "Expression cannot be assignment target",
51
- "asyncNotInAsyncFunction": "Use of \"async\" not allowed outside of async function",
52
- "awaitIllegal": "Use of \"await\" requires Python 3.5 or newer",
53
- "awaitNotAllowed": "Type expressions cannot use \"await\"",
54
- "awaitNotInAsync": "\"await\" allowed only within async function",
55
- "backticksIllegal": "Expressions surrounded by backticks are not supported in Python 3.x; use repr instead",
75
+ "asyncNotInAsyncFunction": {
76
+ "message": "Use of \"async\" not allowed outside of async function",
77
+ "comment": "{Locked='async'}"
78
+ },
79
+ "awaitIllegal": {
80
+ "message": "Use of \"await\" requires Python 3.5 or newer",
81
+ "comment": "{Locked='await'}"
82
+ },
83
+ "awaitNotAllowed": {
84
+ "message": "Type expressions cannot use \"await\"",
85
+ "comment": "{Locked='await'}"
86
+ },
87
+ "awaitNotInAsync": {
88
+ "message": "\"await\" allowed only within async function",
89
+ "comment": "{Locked='await','async'}"
90
+ },
91
+ "backticksIllegal": {
92
+ "message": "Expressions surrounded by backticks are not supported in Python 3.x; use repr instead",
93
+ "comment": "{Locked='repr'}"
94
+ },
56
95
  "baseClassCircular": "Class cannot derive from itself",
57
- "baseClassFinal": "Base class \"{type}\" is marked final and cannot be subclassed",
96
+ "baseClassFinal": {
97
+ "message": "Base class \"{type}\" is marked final and cannot be subclassed",
98
+ "comment": "{Locked='final'}"
99
+ },
58
100
  "baseClassIncompatible": "Base classes of {type} are mutually incompatible",
59
101
  "baseClassInvalid": "Argument to class must be a base class",
60
102
  "baseClassMethodTypeIncompatible": "Base classes for class \"{classType}\" define method \"{name}\" in incompatible way",
61
103
  "baseClassUnknown": "Base class type is unknown, obscuring type of derived class",
62
104
  "baseClassVariableTypeIncompatible": "Base classes for class \"{classType}\" define variable \"{name}\" in incompatible way",
63
105
  "binaryOperationNotAllowed": "Binary operator not allowed in type expression",
64
- "bindTypeMismatch": "Could not bind method \"{methodName}\" because \"{type}\" is not assignable to parameter \"{paramName}\"",
65
- "breakOutsideLoop": "\"break\" can be used only within a loop",
66
- "callableExtraArgs": "Expected only two type arguments to \"Callable\"",
106
+ "bindTypeMismatch": {
107
+ "message": "Could not bind method \"{methodName}\" because \"{type}\" is not assignable to parameter \"{paramName}\"",
108
+ "comment": "Binding is the process through which Pyright determines what object a name refers to"
109
+ },
110
+ "breakOutsideLoop": {
111
+ "message": "\"break\" can be used only within a loop",
112
+ "comment": "{Locked='break'}"
113
+ },
114
+ "callableExtraArgs": {
115
+ "message": "Expected only two type arguments to \"Callable\"",
116
+ "comment": "{Locked='Callable'}"
117
+ },
67
118
  "callableFirstArg": "Expected parameter type list or \"...\"",
68
119
  "callableNotInstantiable": "Cannot instantiate type \"{type}\"",
69
- "callableSecondArg": "Expected return type as second type argument for \"Callable\"",
120
+ "callableSecondArg": {
121
+ "message": "Expected return type as second type argument for \"Callable\"",
122
+ "comment": "{Locked='Callable'}"
123
+ },
70
124
  "casePatternIsIrrefutable": "Irrefutable pattern is allowed only for the last case statement",
71
125
  "classAlreadySpecialized": "Type \"{type}\" is already specialized",
72
126
  "classDecoratorTypeUnknown": "Untyped class decorator obscures type of class; ignoring decorator",
73
127
  "classDefinitionCycle": "Class definition for \"{name}\" depends on itself",
74
- "classGetItemClsParam": "__class_getitem__ override should take a \"cls\" parameter",
75
- "classMethodClsParam": "Class methods should take a \"cls\" parameter",
128
+ "classGetItemClsParam": {
129
+ "message": "__class_getitem__ override should take a \"cls\" parameter",
130
+ "comment": "{Locked='__class_getitem__','cls'}"
131
+ },
132
+ "classMethodClsParam": {
133
+ "message": "Class methods should take a \"cls\" parameter",
134
+ "comment": "{Locked='cls'}"
135
+ },
76
136
  "classNotRuntimeSubscriptable": "Subscript for class \"{name}\" will generate runtime exception; enclose type expression in quotes",
77
137
  "classPatternBuiltInArgPositional": "Class pattern accepts only positional sub-pattern",
78
138
  "classPatternPositionalArgCount": "Too many positional patterns for class \"{type}\"; expected {expected} but received {received}",
79
139
  "classPatternTypeAlias": "\"{type}\" cannot be used in a class pattern because it is a specialized type alias",
80
140
  "classPropertyDeprecated": "Class properties are deprecated in Python 3.11 and will not be supported in Python 3.13",
81
141
  "classTypeParametersIllegal": "Class type parameter syntax requires Python 3.12 or newer",
82
- "classVarFirstArgMissing": "Expected a type argument after \"ClassVar\"",
83
- "classVarNotAllowed": "\"ClassVar\" is not allowed in this context",
142
+ "classVarFirstArgMissing": {
143
+ "message": "Expected a type argument after \"ClassVar\"",
144
+ "comment": "{Locked='ClassVar'}"
145
+ },
146
+ "classVarNotAllowed": {
147
+ "message": "\"ClassVar\" is not allowed in this context",
148
+ "comment": "{Locked='ClassVar'}"
149
+ },
84
150
  "classVarOverridesInstanceVar": "Class variable \"{name}\" overrides instance variable of same name in class \"{className}\"",
85
- "classVarTooManyArgs": "Expected only one type argument after \"ClassVar\"",
86
- "classVarWithTypeVar": "\"ClassVar\" type cannot include type variables",
151
+ "classVarTooManyArgs": {
152
+ "message": "Expected only one type argument after \"ClassVar\"",
153
+ "comment": "{Locked='ClassVar'}"
154
+ },
155
+ "classVarWithTypeVar": {
156
+ "message": "\"ClassVar\" type cannot include type variables",
157
+ "comment": "{Locked='ClassVar'}"
158
+ },
87
159
  "clsSelfParamTypeMismatch": "Type of parameter \"{name}\" must be a supertype of its class \"{classType}\"",
88
160
  "codeTooComplexToAnalyze": "Code is too complex to analyze; reduce complexity by refactoring into subroutines or reducing conditional code paths",
89
161
  "collectionAliasInstantiation": "Type \"{type}\" cannot be instantiated, use \"{alias}\" instead",
90
- "comparisonAlwaysFalse": "Condition will always evaluate to False since the types \"{leftType}\" and \"{rightType}\" have no overlap",
91
- "comparisonAlwaysTrue": "Condition will always evaluate to True since the types \"{leftType}\" and \"{rightType}\" have no overlap",
92
- "comprehensionInDict": "Comprehension cannot be used with other dictionary entries",
93
- "comprehensionInSet": "Comprehension cannot be used with other set entries",
94
- "concatenateContext": "\"Concatenate\" is not allowed in this context",
95
- "concatenateParamSpecMissing": "Last type argument for \"Concatenate\" must be a ParamSpec or \"...\"",
96
- "concatenateTypeArgsMissing": "\"Concatenate\" requires at least two type arguments",
162
+ "comparisonAlwaysFalse": {
163
+ "message": "Condition will always evaluate to False since the types \"{leftType}\" and \"{rightType}\" have no overlap",
164
+ "comment": "{Locked='False'}"
165
+ },
166
+ "comparisonAlwaysTrue": {
167
+ "message": "Condition will always evaluate to True since the types \"{leftType}\" and \"{rightType}\" have no overlap",
168
+ "comment": "{Locked='True'}"
169
+ },
170
+ "comprehensionInDict": {
171
+ "message": "Comprehension cannot be used with other dictionary entries",
172
+ "comment": "A comprehension is a 'set of looping and filtering instructions' applied to a collection to generate a new collection; the word may not be translatable"
173
+ },
174
+ "comprehensionInSet": {
175
+ "message": "Comprehension cannot be used with other set entries",
176
+ "comment": ["{Locked='set'}", "A comprehension is a 'set of looping and filtering instructions' applied to a collection to generate a new collection; the word may not be translatable"]
177
+ },
178
+ "concatenateContext": {
179
+ "message": "\"Concatenate\" is not allowed in this context",
180
+ "comment": "{Locked='Concatenate'}"
181
+ },
182
+ "concatenateParamSpecMissing": {
183
+ "message": "Last type argument for \"Concatenate\" must be a ParamSpec or \"...\"",
184
+ "comment": "{Locked='Concatenate','ParamSpec','...'}"
185
+ },
186
+ "concatenateTypeArgsMissing": {
187
+ "message": "\"Concatenate\" requires at least two type arguments",
188
+ "comment": "{Locked='Concatenate'}"
189
+ },
97
190
  "conditionalOperandInvalid": "Invalid conditional operand of type \"{type}\"",
98
191
  "constantRedefinition": "\"{name}\" is constant (because it is uppercase) and cannot be redefined",
99
- "constructorParametersMismatch": "Mismatch between signature of __new__ and __init__ in class \"{classType}\"",
100
- "containmentAlwaysFalse": "Expression will always evaluate to False since the types \"{leftType}\" and \"{rightType}\" have no overlap",
101
- "containmentAlwaysTrue": "Expression will always evaluate to True since the types \"{leftType}\" and \"{rightType}\" have no overlap",
102
- "continueInFinally": "\"continue\" cannot be used within a finally clause",
103
- "continueOutsideLoop": "\"continue\" can be used only within a loop",
104
- "coroutineInConditionalExpression": "Conditional expression references coroutine which always evaluates to True",
192
+ "constructorParametersMismatch": {
193
+ "message": "Mismatch between signature of __new__ and __init__ in class \"{classType}\"",
194
+ "comment": "{Locked='__new__','__init__'}"
195
+ },
196
+ "containmentAlwaysFalse": {
197
+ "message": "Expression will always evaluate to False since the types \"{leftType}\" and \"{rightType}\" have no overlap",
198
+ "comment": "{Locked='False'}"
199
+ },
200
+ "containmentAlwaysTrue": {
201
+ "message": "Expression will always evaluate to True since the types \"{leftType}\" and \"{rightType}\" have no overlap",
202
+ "comment": "{Locked='True'}"
203
+ },
204
+ "continueInFinally": {
205
+ "message": "\"continue\" cannot be used within a finally clause",
206
+ "comment": "{Locked='continue','finally'}"
207
+ },
208
+ "continueOutsideLoop": {
209
+ "message": "\"continue\" can be used only within a loop",
210
+ "comment": "{Locked='continue'}"
211
+ },
212
+ "coroutineInConditionalExpression": {
213
+ "message": "Conditional expression references coroutine which always evaluates to True",
214
+ "comment": "{Locked='True'}"
215
+ },
105
216
  "dataClassBaseClassFrozen": "A non-frozen class cannot inherit from a class that is frozen",
106
217
  "dataClassBaseClassNotFrozen": "A frozen class cannot inherit from a class that is not frozen",
107
218
  "dataClassConverterFunction": "Argument of type \"{argType}\" is not a valid converter for field \"{fieldName}\" of type \"{fieldType}\"",
@@ -110,14 +221,38 @@
110
221
  "dataClassFieldWithDefault": "Fields without default values cannot appear after fields with default values",
111
222
  "dataClassFieldWithPrivateName": "Dataclass field cannot use private name",
112
223
  "dataClassFieldWithoutAnnotation": "Dataclass field without type annotation will cause runtime exception",
113
- "dataClassPostInitParamCount": "Dataclass __post_init__ incorrect parameter count; number of InitVar fields is {expected}",
114
- "dataClassPostInitType": "Dataclass __post_init__ method parameter type mismatch for field \"{fieldName}\"",
115
- "dataClassSlotsOverwrite": "__slots__ is already defined in class",
116
- "dataClassTransformExpectedBoolLiteral": "Expected expression that statically evaluates to True or False",
117
- "dataClassTransformFieldSpecifier": "Expected tuple of classes or functions but received type \"{type}\"",
118
- "dataClassTransformPositionalParam": "All arguments to \"dataclass_transform\" must be keyword arguments",
119
- "dataClassTransformUnknownArgument": "Argument \"{name}\" is not supported by dataclass_transform",
120
- "dataProtocolInSubclassCheck": "Data protocols (which include non-method attributes) are not allowed in issubclass calls",
224
+ "dataClassPostInitParamCount": {
225
+ "message": "Dataclass __post_init__ incorrect parameter count; number of InitVar fields is {expected}",
226
+ "comment": "{Locked='__post_init__','InitVar'}"
227
+ },
228
+ "dataClassPostInitType": {
229
+ "message": "Dataclass __post_init__ method parameter type mismatch for field \"{fieldName}\"",
230
+ "comment": "{Locked='__post_init__'}"
231
+ },
232
+ "dataClassSlotsOverwrite": {
233
+ "message": "__slots__ is already defined in class",
234
+ "comment": "{Locked='__slots__'}"
235
+ },
236
+ "dataClassTransformExpectedBoolLiteral": {
237
+ "message": "Expected expression that statically evaluates to True or False",
238
+ "comment": "{Locked='True','False'}"
239
+ },
240
+ "dataClassTransformFieldSpecifier": {
241
+ "message": "Expected tuple of classes or functions but received type \"{type}\"",
242
+ "comment": "{Locked='tuple'}"
243
+ },
244
+ "dataClassTransformPositionalParam": {
245
+ "message": "All arguments to \"dataclass_transform\" must be keyword arguments",
246
+ "comment": "{Locked='dataclass_transform'}"
247
+ },
248
+ "dataClassTransformUnknownArgument": {
249
+ "message": "Argument \"{name}\" is not supported by dataclass_transform",
250
+ "comment": "{Locked='dataclass_transform'}"
251
+ },
252
+ "dataProtocolInSubclassCheck": {
253
+ "message": "Data protocols (which include non-method attributes) are not allowed in issubclass calls",
254
+ "comment": "{Locked='issubclass'}"
255
+ },
121
256
  "declaredReturnTypePartiallyUnknown": "Declared return type, \"{returnType}\", is partially unknown",
122
257
  "declaredReturnTypeUnknown": "Declared return type is unknown",
123
258
  "defaultValueContainsCall": "Function calls and mutable objects not allowed within parameter default value expression",
@@ -130,21 +265,45 @@
130
265
  "deprecatedDescriptorSetter": "The \"__set__\" method for descriptor \"{name}\" is deprecated",
131
266
  "deprecatedFunction": "The function \"{name}\" is deprecated",
132
267
  "deprecatedMethod": "The method \"{name}\" in class \"{className}\" is deprecated",
133
- "deprecatedPropertyDeleter": "The deleter for property \"{name}\" is deprecated",
134
- "deprecatedPropertyGetter": "The getter for property \"{name}\" is deprecated",
135
- "deprecatedPropertySetter": "The setter for property \"{name}\" is deprecated",
268
+ "deprecatedPropertyDeleter": {
269
+ "message": "The deleter for property \"{name}\" is deprecated",
270
+ "comment": "{Locked='deleter','property'}"
271
+ },
272
+ "deprecatedPropertyGetter": {
273
+ "message": "The getter for property \"{name}\" is deprecated",
274
+ "comment": "{Locked='getter','property'}"
275
+ },
276
+ "deprecatedPropertySetter": {
277
+ "message": "The setter for property \"{name}\" is deprecated",
278
+ "comment": "{Locked='setter','property'}"
279
+ },
136
280
  "deprecatedType": "This type is deprecated as of Python {version}; use \"{replacement}\" instead",
137
- "dictExpandIllegalInComprehension": "Dictionary expansion not allowed in comprehension",
281
+ "dictExpandIllegalInComprehension": {
282
+ "message": "Dictionary expansion not allowed in comprehension",
283
+ "comment": "A comprehension is a 'set of looping and filtering instructions' applied to a collection to generate a new collection; the word may not be translatable"
284
+ },
138
285
  "dictInAnnotation": "Dictionary expression not allowed in type expression",
139
286
  "dictKeyValuePairs": "Dictionary entries must contain key/value pairs",
140
287
  "dictUnpackIsNotMapping": "Expected mapping for dictionary unpack operator",
141
- "dunderAllSymbolNotPresent": "\"{name}\" is specified in __all__ but is not present in module",
288
+ "dunderAllSymbolNotPresent": {
289
+ "message": "\"{name}\" is specified in __all__ but is not present in module",
290
+ "comment": "{Locked='__all__'}"
291
+ },
142
292
  "duplicateArgsParam": "Only one \"*\" parameter allowed",
143
293
  "duplicateBaseClass": "Duplicate base class not allowed",
144
294
  "duplicateCapturePatternTarget": "Capture target \"{name}\" cannot appear more than once within the same pattern",
145
- "duplicateCatchAll": "Only one catch-all except clause allowed",
146
- "duplicateEnumMember": "Enum member \"{name}\" is already declared",
147
- "duplicateGenericAndProtocolBase": "Only one Generic[...] or Protocol[...] base class allowed",
295
+ "duplicateCatchAll": {
296
+ "message": "Only one catch-all except clause allowed",
297
+ "comment": "{Locked='except'}"
298
+ },
299
+ "duplicateEnumMember": {
300
+ "message": "Enum member \"{name}\" is already declared",
301
+ "comment": "{Locked='Enum'}"
302
+ },
303
+ "duplicateGenericAndProtocolBase": {
304
+ "message": "Only one Generic[...] or Protocol[...] base class allowed",
305
+ "comment": "{Locked='Generic[...]','Protocol[...]'}"
306
+ },
148
307
  "duplicateImport": "\"{importName}\" is imported more than once",
149
308
  "duplicateKeywordOnly": "Only one \"*\" separator allowed",
150
309
  "duplicateKwargsParam": "Only one \"**\" parameter allowed",
@@ -152,14 +311,32 @@
152
311
  "duplicatePositionOnly": "Only one \"/\" parameter allowed",
153
312
  "duplicateStarPattern": "Only one \"*\" pattern allowed in a pattern sequence",
154
313
  "duplicateStarStarPattern": "Only one \"**\" entry allowed",
155
- "duplicateUnpack": "Only one unpack operation allowed in list",
156
- "ellipsisAfterUnpacked": "\"...\" cannot be used with an unpacked TypeVarTuple or tuple",
314
+ "duplicateUnpack": {
315
+ "message": "Only one unpack operation allowed in list",
316
+ "comment": "{Locked='list'}"
317
+ },
318
+ "ellipsisAfterUnpacked": {
319
+ "message": "\"...\" cannot be used with an unpacked TypeVarTuple or tuple",
320
+ "comment": "{Locked='TypeVarTuple','tuple'}"
321
+ },
157
322
  "ellipsisContext": "\"...\" is not allowed in this context",
158
323
  "ellipsisSecondArg": "\"...\" is allowed only as the second of two arguments",
159
- "enumClassOverride": "Enum class \"{name}\" is final and cannot be subclassed",
160
- "enumMemberDelete": "Enum member \"{name}\" cannot be deleted",
161
- "enumMemberSet": "Enum member \"{name}\" cannot be assigned",
162
- "enumMemberTypeAnnotation": "Type annotations are not allowed for enum members",
324
+ "enumClassOverride": {
325
+ "message": "Enum class \"{name}\" is final and cannot be subclassed",
326
+ "comment": "{Locked='Enum','final'}"
327
+ },
328
+ "enumMemberDelete": {
329
+ "message": "Enum member \"{name}\" cannot be deleted",
330
+ "comment": "{Locked='Enum'}"
331
+ },
332
+ "enumMemberSet": {
333
+ "message": "Enum member \"{name}\" cannot be assigned",
334
+ "comment": "{Locked='Enum'}"
335
+ },
336
+ "enumMemberTypeAnnotation": {
337
+ "message": "Type annotations are not allowed for enum members",
338
+ "comment": "{Locked='enum'}"
339
+ },
163
340
  "exceptionGroupIncompatible": {
164
341
  "message": "Exception group syntax (\"except*\") requires Python 3.11 or newer",
165
342
  "comment": "{Locked='except*'}"
@@ -168,46 +345,91 @@
168
345
  "message": "Exception type in except* cannot derive from BaseGroupException",
169
346
  "comment": "{Locked='except*','BaseGroupException'}"
170
347
  },
171
- "exceptionTypeIncorrect": "\"{type}\" does not derive from BaseException",
348
+ "exceptionTypeIncorrect": {
349
+ "message": "\"{type}\" does not derive from BaseException",
350
+ "comment": "{Locked='BaseException'}"
351
+ },
172
352
  "exceptionTypeNotClass": "\"{type}\" is not a valid exception class",
173
353
  "exceptionTypeNotInstantiable": "Constructor for exception type \"{type}\" requires one or more arguments",
174
354
  "expectedAfterDecorator": "Expected function or class declaration after decorator",
175
355
  "expectedArrow": "Expected \"->\" followed by return type annotation",
176
- "expectedAsAfterException": "Expected \"as\" after exception type",
356
+ "expectedAsAfterException": {
357
+ "message": "Expected \"as\" after exception type",
358
+ "comment": "{Locked='as'}"
359
+ },
177
360
  "expectedAssignRightHandExpr": "Expected expression to the right of \"=\"",
178
361
  "expectedBinaryRightHandExpr": "Expected expression to the right of operator",
179
362
  "expectedBoolLiteral": {
180
363
  "message": "Expected True or False",
181
364
  "comment": "{Locked='True','False'}"
182
365
  },
183
- "expectedCase": "Expected \"case\" statement",
366
+ "expectedCase": {
367
+ "message": "Expected \"case\" statement",
368
+ "comment": "{Locked='case'}"
369
+ },
184
370
  "expectedClassName": "Expected class name",
185
371
  "expectedCloseBrace": "\"{\" was not closed",
186
372
  "expectedCloseBracket": "\"[\" was not closed",
187
373
  "expectedCloseParen": "\"(\" was not closed",
188
374
  "expectedColon": "Expected \":\"",
189
- "expectedComplexNumberLiteral": "Expected complex number literal for pattern matching",
375
+ "expectedComplexNumberLiteral": {
376
+ "message": "Expected complex number literal for pattern matching",
377
+ "comment": "Complex numbers are a mathematical concept consisting of a real number and an imaginary number"
378
+ },
190
379
  "expectedDecoratorExpr": "Expression form not supported for decorator prior to Python 3.9",
191
380
  "expectedDecoratorName": "Expected decorator name",
192
381
  "expectedDecoratorNewline": "Expected new line at end of decorator",
193
- "expectedDelExpr": "Expected expression after \"del\"",
194
- "expectedElse": "Expected \"else\"",
382
+ "expectedDelExpr": {
383
+ "message": "Expected expression after \"del\"",
384
+ "comment": "{Locked='del'}"
385
+ },
386
+ "expectedElse": {
387
+ "message": "Expected \"else\"",
388
+ "comment": "{Locked='else'}"
389
+ },
195
390
  "expectedEquals": "Expected \"=\"",
196
391
  "expectedExceptionClass": "Invalid exception class or object",
197
- "expectedExceptionObj": "Expected exception object, exception class or None",
392
+ "expectedExceptionObj": {
393
+ "message": "Expected exception object, exception class or None",
394
+ "comment": "{Locked='None'}"
395
+ },
198
396
  "expectedExpr": "Expected expression",
199
- "expectedFunctionAfterAsync": "Expected function definition after \"async\"",
200
- "expectedFunctionName": "Expected function name after \"def\"",
397
+ "expectedFunctionAfterAsync": {
398
+ "message": "Expected function definition after \"async\"",
399
+ "comment": "{Locked='async'}"
400
+ },
401
+ "expectedFunctionName": {
402
+ "message": "Expected function name after \"def\"",
403
+ "comment": "{Locked='def'}"
404
+ },
201
405
  "expectedIdentifier": "Expected identifier",
202
- "expectedImport": "Expected \"import\"",
203
- "expectedImportAlias": "Expected symbol after \"as\"",
204
- "expectedImportSymbols": "Expected one or more symbol names after import",
205
- "expectedIn": "Expected \"in\"",
206
- "expectedInExpr": "Expected expression after \"in\"",
406
+ "expectedImport": {
407
+ "message": "Expected \"import\"",
408
+ "comment": "{Locked='import'}"
409
+ },
410
+ "expectedImportAlias": {
411
+ "message": "Expected symbol after \"as\"",
412
+ "comment": "{Locked='as'}"
413
+ },
414
+ "expectedImportSymbols": {
415
+ "message": "Expected one or more symbol names after \"import\"",
416
+ "comment": "{Locked='import'}"
417
+ },
418
+ "expectedIn": {
419
+ "message": "Expected \"in\"",
420
+ "comment": "{Locked='in'}"
421
+ },
422
+ "expectedInExpr": {
423
+ "message": "Expected expression after \"in\"",
424
+ "comment": "{Locked='in'}"
425
+ },
207
426
  "expectedIndentedBlock": "Expected indented block",
208
427
  "expectedMemberName": "Expected attribute name after \".\"",
209
428
  "expectedModuleName": "Expected module name",
210
- "expectedNameAfterAs": "Expected symbol name after \"as\"",
429
+ "expectedNameAfterAs": {
430
+ "message": "Expected symbol name after \"as\"",
431
+ "comment": "{Locked='as'}"
432
+ },
211
433
  "expectedNamedParameter": "Keyword parameter must follow \"*\"",
212
434
  "expectedNewline": "Expected newline",
213
435
  "expectedNewlineOrSemicolon": "Statements must be separated by newlines or semicolons",
@@ -215,51 +437,162 @@
215
437
  "expectedParamName": "Expected parameter name",
216
438
  "expectedPatternExpr": "Expected pattern expression",
217
439
  "expectedPatternSubjectExpr": "Expected pattern subject expression",
218
- "expectedPatternValue": "Expected pattern value expression of the form \"a.b\"",
219
- "expectedReturnExpr": "Expected expression after \"return\"",
440
+ "expectedPatternValue": {
441
+ "message": "Expected pattern value expression of the form \"a.b\"",
442
+ "comment": "{Locked='a.b'}"
443
+ },
444
+ "expectedReturnExpr": {
445
+ "message": "Expected expression after \"return\"",
446
+ "comment": "{Locked='return'}"
447
+ },
220
448
  "expectedSliceIndex": "Expected index or slice expression",
221
449
  "expectedTypeNotString": "Expected type but received a string literal",
222
450
  "expectedTypeParameterName": "Expected type parameter name",
223
- "expectedYieldExpr": "Expected expression in yield statement",
224
- "finalClassIsAbstract": "Class \"{type}\" is marked final and must implement all abstract symbols",
225
- "finalContext": "\"Final\" is not allowed in this context",
226
- "finalInLoop": "A \"Final\" variable cannot be assigned within a loop",
227
- "finalMethodOverride": "Method \"{name}\" cannot override final method defined in class \"{className}\"",
228
- "finalNonMethod": "Function \"{name}\" cannot be marked @final because it is not a method",
229
- "finalReassigned": "\"{name}\" is declared as Final and cannot be reassigned",
230
- "finalRedeclaration": "\"{name}\" was previously declared as Final",
231
- "finalRedeclarationBySubclass": "\"{name}\" cannot be redeclared because parent class \"{className}\" declares it as Final",
232
- "finalTooManyArgs": "Expected a single type argument after \"Final\"",
233
- "finalUnassigned": "\"{name}\" is declared Final, but value is not assigned",
234
- "formatStringBrace": "Single close brace not allowed within f-string literal; use double close brace",
235
- "formatStringBytes": "Format string literals (f-strings) cannot be binary",
236
- "formatStringDebuggingIllegal": "F-string debugging specifier \"=\" requires Python 3.8 or newer",
237
- "formatStringEscape": "Escape sequence (backslash) not allowed in expression portion of f-string prior to Python 3.12",
238
- "formatStringExpectedConversion": "Expected a conversion specifier after \"!\" in f-string",
239
- "formatStringIllegal": "Format string literals (f-strings) require Python 3.6 or newer",
451
+ "expectedYieldExpr": {
452
+ "message": "Expected expression in yield statement",
453
+ "comment": "{Locked='yield'}"
454
+ },
455
+ "finalClassIsAbstract": {
456
+ "message": "Class \"{type}\" is marked final and must implement all abstract symbols",
457
+ "comment": "{Locked='final'}"
458
+ },
459
+ "finalContext": {
460
+ "message": "\"Final\" is not allowed in this context",
461
+ "comment": "{Locked='Final'}"
462
+ },
463
+ "finalInLoop": {
464
+ "message": "A \"Final\" variable cannot be assigned within a loop",
465
+ "comment": "{Locked='Final'}"
466
+ },
467
+ "finalMethodOverride": {
468
+ "message": "Method \"{name}\" cannot override final method defined in class \"{className}\"",
469
+ "comment": "{Locked='final'}"
470
+ },
471
+ "finalNonMethod": {
472
+ "message": "Function \"{name}\" cannot be marked @final because it is not a method",
473
+ "comment": "{Locked='@final'}"
474
+ },
475
+ "finalReassigned": {
476
+ "message": "\"{name}\" is declared as Final and cannot be reassigned",
477
+ "comment": "{Locked='Final'}"
478
+ },
479
+ "finalRedeclaration": {
480
+ "message": "\"{name}\" was previously declared as Final",
481
+ "comment": "{Locked='Final'}"
482
+ },
483
+ "finalRedeclarationBySubclass": {
484
+ "message": "\"{name}\" cannot be redeclared because parent class \"{className}\" declares it as Final",
485
+ "comment": "{Locked='Final'}"
486
+ },
487
+ "finalTooManyArgs": {
488
+ "message": "Expected a single type argument after \"Final\"",
489
+ "comment": "{Locked='Final'}"
490
+ },
491
+ "finalUnassigned": {
492
+ "message": "\"{name}\" is declared Final, but value is not assigned",
493
+ "comment": "{Locked='Final'}"
494
+ },
495
+ "formatStringBrace": {
496
+ "message": "Single close brace not allowed within f-string literal; use double close brace",
497
+ "comment": "'f-string' is the common English slang for a Python format string"
498
+ },
499
+ "formatStringBytes": {
500
+ "message": "Format string literals (f-strings) cannot be binary",
501
+ "comment": "'f-string' is the common English slang for a Python format string"
502
+ },
503
+ "formatStringDebuggingIllegal": {
504
+ "message": "F-string debugging specifier \"=\" requires Python 3.8 or newer",
505
+ "comment": "'f-string' is the common English slang for a Python format string"
506
+ },
507
+ "formatStringEscape": {
508
+ "message": "Escape sequence (backslash) not allowed in expression portion of f-string prior to Python 3.12",
509
+ "comment": "'f-string' is the common English slang for a Python format string"
510
+ },
511
+ "formatStringExpectedConversion": {
512
+ "message": "Expected a conversion specifier after \"!\" in f-string",
513
+ "comment": "'f-string' is the common English slang for a Python format string"
514
+ },
515
+ "formatStringIllegal": {
516
+ "message": "Format string literals (f-strings) require Python 3.6 or newer",
517
+ "comment": "'f-string' is the common English slang for a Python format string"
518
+ },
240
519
  "formatStringInPattern": "Format string not allowed in pattern",
241
520
  "formatStringNestedFormatSpecifier": "Expressions nested too deeply within format string specifier",
242
- "formatStringNestedQuote": "Strings nested within an f-string cannot use the same quote character as the f-string prior to Python 3.12",
243
- "formatStringUnicode": "Format string literals (f-strings) cannot be unicode",
244
- "formatStringUnterminated": "Unterminated expression in f-string; expecting \"}\"",
521
+ "formatStringNestedQuote": {
522
+ "message": "Strings nested within an f-string cannot use the same quote character as the f-string prior to Python 3.12",
523
+ "comment": "'f-string' is the common English slang for a Python format string"
524
+ },
525
+ "formatStringUnicode": {
526
+ "message": "Format string literals (f-strings) cannot be unicode",
527
+ "comment": "'f-string' is the common English slang for a Python format string"
528
+ },
529
+ "formatStringUnterminated": {
530
+ "message": "Unterminated expression in f-string; expecting \"}\"",
531
+ "comment": "'f-string' is the common English slang for a Python format string"
532
+ },
245
533
  "functionDecoratorTypeUnknown": "Untyped function decorator obscures type of function; ignoring decorator",
246
- "functionInConditionalExpression": "Conditional expression references function which always evaluates to True",
534
+ "functionInConditionalExpression": {
535
+ "message": "Conditional expression references function which always evaluates to True",
536
+ "comment": "{Locked='True'}"
537
+ },
247
538
  "functionTypeParametersIllegal": "Function type parameter syntax requires Python 3.12 or newer",
248
- "futureImportLocationNotAllowed": "Imports from __future__ must be at the beginning of the file",
249
- "generatorAsyncReturnType": "Return type of async generator function must be compatible with \"AsyncGenerator[{yieldType}, Any]\"",
539
+ "futureImportLocationNotAllowed": {
540
+ "message": "Imports from __future__ must be at the beginning of the file",
541
+ "comment": "{Locked='__future__'}"
542
+ },
543
+ "generatorAsyncReturnType": {
544
+ "message": "Return type of async generator function must be compatible with \"AsyncGenerator[{yieldType}, Any]\"",
545
+ "comment": "{Locked='async','AsyncGenerator[{yieldType}, Any]'}"
546
+ },
250
547
  "generatorNotParenthesized": "Generator expressions must be parenthesized if not sole argument",
251
- "generatorSyncReturnType": "Return type of generator function must be compatible with \"Generator[{yieldType}, Any, Any]\"",
252
- "genericBaseClassNotAllowed": "\"Generic\" base class cannot be used with type parameter syntax",
253
- "genericClassAssigned": "Generic class type cannot be assigned",
254
- "genericClassDeleted": "Generic class type cannot be deleted",
255
- "genericInstanceVariableAccess": "Access to generic instance variable through class is ambiguous",
256
- "genericNotAllowed": "\"Generic\" is not valid in this context",
257
- "genericTypeAliasBoundTypeVar": "Generic type alias within class cannot use bound type variables {names}",
258
- "genericTypeArgMissing": "\"Generic\" requires at least one type argument",
259
- "genericTypeArgTypeVar": "Type argument for \"Generic\" must be a type variable",
260
- "genericTypeArgUnique": "Type arguments for \"Generic\" must be unique",
261
- "globalReassignment": "\"{name}\" is assigned before global declaration",
262
- "globalRedefinition": "\"{name}\" was already declared global",
548
+ "generatorSyncReturnType": {
549
+ "message": "Return type of generator function must be compatible with \"Generator[{yieldType}, Any, Any]\"",
550
+ "comment": "{Locked='Generator[{yieldType}, Any, Any]'}"
551
+ },
552
+ "genericBaseClassNotAllowed": {
553
+ "message": "\"Generic\" base class cannot be used with type parameter syntax",
554
+ "comment": "{Locked='Generic'}"
555
+ },
556
+ "genericClassAssigned": {
557
+ "message": "Generic class type cannot be assigned",
558
+ "comment": "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"
559
+ },
560
+ "genericClassDeleted": {
561
+ "message": "Generic class type cannot be deleted",
562
+ "comment": "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"
563
+ },
564
+ "genericInstanceVariableAccess": {
565
+ "message": "Access to generic instance variable through class is ambiguous",
566
+ "comment": "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"
567
+ },
568
+ "genericNotAllowed": {
569
+ "message": "\"Generic\" is not valid in this context",
570
+ "comment": "{Locked='Generic'}"
571
+ },
572
+ "genericTypeAliasBoundTypeVar": {
573
+ "message": "Generic type alias within class cannot use bound type variables {names}",
574
+ "comment": "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"
575
+ },
576
+ "genericTypeArgMissing": {
577
+ "message": "\"Generic\" requires at least one type argument",
578
+ "comment": "{Locked='Generic'}"
579
+ },
580
+ "genericTypeArgTypeVar": {
581
+ "message": "Type argument for \"Generic\" must be a type variable",
582
+ "comment": "{Locked='Generic'}"
583
+ },
584
+ "genericTypeArgUnique": {
585
+ "message": "Type arguments for \"Generic\" must be unique",
586
+ "comment": "{Locked='Generic'}"
587
+ },
588
+ "globalReassignment": {
589
+ "message": "\"{name}\" is assigned before global declaration",
590
+ "comment": "{Locked='global'}"
591
+ },
592
+ "globalRedefinition": {
593
+ "message": "\"{name}\" was already declared global",
594
+ "comment": "{Locked='global'}"
595
+ },
263
596
  "implicitStringConcat": "Implicit string concatenation not allowed",
264
597
  "importCycleDetected": "Cycle detected in import chain",
265
598
  "importDepthExceeded": "Import chain depth exceeded {depth}",
@@ -269,24 +602,60 @@
269
602
  "incompatibleMethodOverride": "Method \"{name}\" overrides class \"{className}\" in an incompatible manner",
270
603
  "inconsistentIndent": "Unindent amount does not match previous indent",
271
604
  "inconsistentTabs": "Inconsistent use of tabs and spaces in indentation",
272
- "initMethodSelfParamTypeVar": "Type annotation for \"self\" parameter of \"__init__\" method cannot contain class-scoped type variables",
273
- "initMustReturnNone": "Return type of \"__init__\" must be None",
274
- "initSubclassCallFailed": "Incorrect keyword arguments for __init_subclass__ method",
275
- "initSubclassClsParam": "__init_subclass__ override should take a \"cls\" parameter",
276
- "initVarNotAllowed": "\"InitVar\" is not allowed in this context",
277
- "instanceMethodSelfParam": "Instance methods should take a \"self\" parameter",
605
+ "initMethodSelfParamTypeVar": {
606
+ "message": "Type annotation for \"self\" parameter of \"__init__\" method cannot contain class-scoped type variables",
607
+ "comment": "{Locked='self','__init__'}"
608
+ },
609
+ "initMustReturnNone": {
610
+ "message": "Return type of \"__init__\" must be None",
611
+ "comment": "{Locked='__init__','None'}"
612
+ },
613
+ "initSubclassCallFailed": {
614
+ "message": "Incorrect keyword arguments for __init_subclass__ method",
615
+ "comment": "{Locked='__init_subclass__'}"
616
+ },
617
+ "initSubclassClsParam": {
618
+ "message": "__init_subclass__ override should take a \"cls\" parameter",
619
+ "comment": "{Locked='__init_subclass__','cls'}"
620
+ },
621
+ "initVarNotAllowed": {
622
+ "message": "\"InitVar\" is not allowed in this context",
623
+ "comment": "{Locked='InitVar'}"
624
+ },
625
+ "instanceMethodSelfParam": {
626
+ "message": "Instance methods should take a \"self\" parameter",
627
+ "comment": "{Locked='self'}"
628
+ },
278
629
  "instanceVarOverridesClassVar": "Instance variable \"{name}\" overrides class variable of same name in class \"{className}\"",
279
630
  "instantiateAbstract": "Cannot instantiate abstract class \"{type}\"",
280
- "instantiateProtocol": "Cannot instantiate protocol class \"{type}\"",
281
- "internalBindError": "An internal error occurred while binding file \"{file}\": {message}",
631
+ "instantiateProtocol": {
632
+ "message": "Cannot instantiate Protocol class \"{type}\"",
633
+ "comment": "{Locked='Protocol'}"
634
+ },
635
+ "internalBindError": {
636
+ "message": "An internal error occurred while binding file \"{file}\": {message}",
637
+ "comment": "Binding is the process through which Pyright determines what object a name refers to"
638
+ },
282
639
  "internalParseError": "An internal error occurred while parsing file \"{file}\": {message}",
283
640
  "internalTypeCheckingError": "An internal error occurred while type checking file \"{file}\": {message}",
284
641
  "invalidIdentifierChar": "Invalid character in identifier",
285
- "invalidStubStatement": "Statement is meaningless within a type stub file",
642
+ "invalidStubStatement": {
643
+ "message": "Statement is meaningless within a type stub file",
644
+ "comment": "{StrContains=i'stub'}"
645
+ },
286
646
  "invalidTokenChars": "Invalid character \"{text}\" in token",
287
- "isInstanceInvalidType": "Second argument to \"isinstance\" must be a class or tuple of classes",
288
- "isSubclassInvalidType": "Second argument to \"issubclass\" must be a class or tuple of classes",
289
- "keyValueInSet": "Key/value pairs are not allowed within a set",
647
+ "isInstanceInvalidType": {
648
+ "message": "Second argument to \"isinstance\" must be a class or tuple of classes",
649
+ "comment": "{Locked='isinstance','tuple'}"
650
+ },
651
+ "isSubclassInvalidType": {
652
+ "message": "Second argument to \"issubclass\" must be a class or tuple of classes",
653
+ "comment": "{Locked='issubclass','tuple'}"
654
+ },
655
+ "keyValueInSet": {
656
+ "message": "Key/value pairs are not allowed within a set",
657
+ "comment": "{Locked='set'}"
658
+ },
290
659
  "keywordArgInTypeArgument": "Keyword arguments cannot be used in type argument lists",
291
660
  "keywordArgShortcutIllegal": "Keyword argument shortcut requires Python 3.14 or newer",
292
661
  "keywordOnlyAfterArgs": "Keyword-only argument separator not allowed after \"*\" parameter",
@@ -295,67 +664,202 @@
295
664
  "lambdaReturnTypePartiallyUnknown": "Return type of lambda, \"{returnType}\", is partially unknown",
296
665
  "lambdaReturnTypeUnknown": "Return type of lambda is unknown",
297
666
  "listAssignmentMismatch": "Expression with type \"{type}\" cannot be assigned to target list",
298
- "listInAnnotation": "List expression not allowed in type expression",
299
- "literalEmptyArgs": "Expected one or more type arguments after \"Literal\"",
300
- "literalNamedUnicodeEscape": "Named unicode escape sequences are not supported in \"Literal\" string annotations",
301
- "literalNotAllowed": "\"Literal\" cannot be used in this context without a type argument",
302
- "literalNotCallable": "Literal type cannot be instantiated",
303
- "literalUnsupportedType": "Type arguments for \"Literal\" must be None, a literal value (int, bool, str, or bytes), or an enum value",
304
- "matchIncompatible": "Match statements require Python 3.10 or newer",
305
- "matchIsNotExhaustive": "Cases within match statement do not exhaustively handle all values",
667
+ "listInAnnotation": {
668
+ "message": "List expression not allowed in type expression",
669
+ "comment": "{Locked='List'}"
670
+ },
671
+ "literalEmptyArgs": {
672
+ "message": "Expected one or more type arguments after \"Literal\"",
673
+ "comment": "{Locked='Literal'}"
674
+ },
675
+ "literalNamedUnicodeEscape": {
676
+ "message": "Named unicode escape sequences are not supported in \"Literal\" string annotations",
677
+ "comment": "{Locked='Literal'}"
678
+ },
679
+ "literalNotAllowed": {
680
+ "message": "\"Literal\" cannot be used in this context without a type argument",
681
+ "comment": "{Locked='Literal'}"
682
+ },
683
+ "literalNotCallable": {
684
+ "message": "Literal type cannot be instantiated",
685
+ "comment": "{Locked='Literal'}"
686
+ },
687
+ "literalUnsupportedType": {
688
+ "message": "Type arguments for \"Literal\" must be None, a literal value (int, bool, str, or bytes), or an enum value",
689
+ "comment": "{Locked='Literal','None','int','bool','str','bytes','enum'}"
690
+ },
691
+ "matchIncompatible": {
692
+ "message": "Match statements require Python 3.10 or newer",
693
+ "comment": ["{StrContains=i'match'}", "'match' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
694
+ },
695
+ "matchIsNotExhaustive": {
696
+ "message": "Cases within match statement do not exhaustively handle all values",
697
+ "comment": ["{Locked='match'}", "Case statements are children of match statements where 'case' is a keyword. It may be best to keep 'case' in English"]
698
+ },
306
699
  "maxParseDepthExceeded": "Maximum parse depth exceeded; break expression into smaller sub-expressions",
307
700
  "memberAccess": "Cannot access attribute \"{name}\" for class \"{type}\"",
308
701
  "memberDelete": "Cannot delete attribute \"{name}\" for class \"{type}\"",
309
702
  "memberSet": "Cannot assign to attribute \"{name}\" for class \"{type}\"",
310
- "metaclassConflict": "The metaclass of a derived class must be a subclass of the metaclasses of all its base classes",
311
- "metaclassDuplicate": "Only one metaclass can be provided",
312
- "metaclassIsGeneric": "Metaclass cannot be generic",
703
+ "metaclassConflict": {
704
+ "message": "The metaclass of a derived class must be a subclass of the metaclasses of all its base classes",
705
+ "comment": "Metaclasses are a complex concept and it may be best to not localize the term"
706
+ },
707
+ "metaclassDuplicate": {
708
+ "message": "Only one metaclass can be provided",
709
+ "comment": "Metaclasses are a complex concept and it may be best to not localize the term"
710
+ },
711
+ "metaclassIsGeneric": {
712
+ "message": "Metaclass cannot be generic",
713
+ "comment": ["Metaclasses are a complex concept and it may be best to not localize the term", "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"]
714
+ },
313
715
  "methodNotDefined": "\"{name}\" method not defined",
314
716
  "methodNotDefinedOnType": "\"{name}\" method not defined on type \"{type}\"",
315
717
  "methodOrdering": "Cannot create consistent method ordering",
316
718
  "methodOverridden": "\"{name}\" overrides method of same name in class \"{className}\" with incompatible type \"{type}\"",
317
719
  "methodReturnsNonObject": "\"{name}\" method does not return an object",
318
720
  "missingSuperCall": "Method \"{methodName}\" does not call the method of the same name in parent class",
319
- "mixingBytesAndStr": "Bytes and str values cannot be concatenated",
721
+ "mixingBytesAndStr": {
722
+ "message": "Bytes and str values cannot be concatenated",
723
+ "comment": ["{Locked='str'}", "{StrContains=i'bytes'}", "'bytes' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
724
+ },
320
725
  "moduleAsType": "Module cannot be used as a type",
321
726
  "moduleNotCallable": "Module is not callable",
322
727
  "moduleUnknownMember": "\"{memberName}\" is not a known attribute of module \"{moduleName}\"",
323
- "namedExceptAfterCatchAll": "A named except clause cannot appear after catch-all except clause",
324
- "namedParamAfterParamSpecArgs": "Keyword parameter \"{name}\" cannot appear in signature after ParamSpec args parameter",
325
- "namedTupleEmptyName": "Names within a named tuple cannot be empty",
326
- "namedTupleEntryRedeclared": "Cannot override \"{name}\" because parent class \"{className}\" is a named tuple",
327
- "namedTupleFirstArg": "Expected named tuple class name as first argument",
328
- "namedTupleMultipleInheritance": "Multiple inheritance with NamedTuple is not supported",
728
+ "namedExceptAfterCatchAll": {
729
+ "message": "A named except clause cannot appear after catch-all except clause",
730
+ "comment": "{Locked='except'}"
731
+ },
732
+ "namedParamAfterParamSpecArgs": {
733
+ "message": "Keyword parameter \"{name}\" cannot appear in signature after ParamSpec args parameter",
734
+ "comment": "{Locked='ParamSpec','args'}"
735
+ },
736
+ "namedTupleEmptyName": {
737
+ "message": "Names within a named tuple cannot be empty",
738
+ "comment": "{Locked='tuple'}"
739
+ },
740
+ "namedTupleEntryRedeclared": {
741
+ "message": "Cannot override \"{name}\" because parent class \"{className}\" is a named tuple",
742
+ "comment": "{Locked='tuple'}"
743
+ },
744
+ "namedTupleFirstArg": {
745
+ "message": "Expected named tuple class name as first argument",
746
+ "comment": "{Locked='tuple'}"
747
+ },
748
+ "namedTupleMultipleInheritance": {
749
+ "message": "Multiple inheritance with NamedTuple is not supported",
750
+ "comment": "{Locked='NamedTuple'}"
751
+ },
329
752
  "namedTupleNameKeyword": "Field names cannot be a keyword",
330
- "namedTupleNameType": "Expected two-entry tuple specifying entry name and type",
331
- "namedTupleNameUnique": "Names within a named tuple must be unique",
332
- "namedTupleNoTypes": "\"namedtuple\" provides no types for tuple entries; use \"NamedTuple\" instead",
333
- "namedTupleSecondArg": "Expected named tuple entry list as second argument",
334
- "newClsParam": "__new__ override should take a \"cls\" parameter",
335
- "newTypeAnyOrUnknown": "The second argument to NewType must be a known class, not Any or Unknown",
336
- "newTypeBadName": "The first argument to NewType must be a string literal",
337
- "newTypeLiteral": "NewType cannot be used with Literal type",
338
- "newTypeNameMismatch": "NewType must be assigned to a variable with the same name",
339
- "newTypeNotAClass": "Expected class as second argument to NewType",
340
- "newTypeParamCount": "NewType requires two positional arguments",
341
- "newTypeProtocolClass": "NewType cannot be used with structural type (a protocol or TypedDict class)",
753
+ "namedTupleNameType": {
754
+ "message": "Expected two-entry tuple specifying entry name and type",
755
+ "comment": "{Locked='tuple'}"
756
+ },
757
+ "namedTupleNameUnique": {
758
+ "message": "Names within a named tuple must be unique",
759
+ "comment": "{Locked='tuple'}"
760
+ },
761
+ "namedTupleNoTypes": {
762
+ "message": "\"namedtuple\" provides no types for tuple entries; use \"NamedTuple\" instead",
763
+ "comment": "{Locked='namedtuple\";'tuple','NamedTuple'}"
764
+ },
765
+ "namedTupleSecondArg": {
766
+ "message": "Expected named tuple entry list as second argument",
767
+ "comment": "{Locked='tuple','list'}"
768
+ },
769
+ "newClsParam": {
770
+ "message": "__new__ override should take a \"cls\" parameter",
771
+ "comment": "{Locked='__new__','cls'}"
772
+ },
773
+ "newTypeAnyOrUnknown": {
774
+ "message": "The second argument to NewType must be a known class, not Any or Unknown",
775
+ "comment": "{Locked='NewType','Any','Unknown'}"
776
+ },
777
+ "newTypeBadName": {
778
+ "message": "The first argument to NewType must be a string literal",
779
+ "comment": "{Locked='NewType'}"
780
+ },
781
+ "newTypeLiteral": {
782
+ "message": "NewType cannot be used with Literal type",
783
+ "comment": "{Locked='NewType','Literal'}"
784
+ },
785
+ "newTypeNameMismatch": {
786
+ "message": "NewType must be assigned to a variable with the same name",
787
+ "comment": "{Locked='NewType'}"
788
+ },
789
+ "newTypeNotAClass": {
790
+ "message": "Expected class as second argument to NewType",
791
+ "comment": "{Locked='NewType'}"
792
+ },
793
+ "newTypeParamCount": {
794
+ "message": "NewType requires two positional arguments",
795
+ "comment": "{Locked='NewType'}"
796
+ },
797
+ "newTypeProtocolClass": {
798
+ "message": "NewType cannot be used with structural type (a Protocol or TypedDict class)",
799
+ "comment": "{Locked='NewType','Protocol','TypedDict'}"
800
+ },
342
801
  "noOverload": "No overloads for \"{name}\" match the provided arguments",
343
- "noReturnContainsReturn": "Function with declared return type \"NoReturn\" cannot include a return statement",
344
- "noReturnContainsYield": "Function with declared return type \"NoReturn\" cannot include a yield statement",
345
- "noReturnReturnsNone": "Function with declared return type \"NoReturn\" cannot return \"None\"",
802
+ "noReturnContainsReturn": {
803
+ "message": "Function with declared return type \"NoReturn\" cannot include a return statement",
804
+ "comment": "{Locked='NoReturn','return'}"
805
+ },
806
+ "noReturnContainsYield": {
807
+ "message": "Function with declared return type \"NoReturn\" cannot include a yield statement",
808
+ "comment": "{Locked='NoReturn','yield'}"
809
+ },
810
+ "noReturnReturnsNone": {
811
+ "message": "Function with declared return type \"NoReturn\" cannot return \"None\"",
812
+ "comment": "{Locked='NoReturn','None'}"
813
+ },
346
814
  "nonDefaultAfterDefault": "Non-default argument follows default argument",
347
- "nonLocalInModule": "Nonlocal declaration not allowed at module level",
348
- "nonLocalNoBinding": "No binding for nonlocal \"{name}\" found",
349
- "nonLocalReassignment": "\"{name}\" is assigned before nonlocal declaration",
350
- "nonLocalRedefinition": "\"{name}\" was already declared nonlocal",
351
- "noneNotCallable": "Object of type \"None\" cannot be called",
352
- "noneNotIterable": "Object of type \"None\" cannot be used as iterable value",
353
- "noneNotSubscriptable": "Object of type \"None\" is not subscriptable",
354
- "noneNotUsableWith": "Object of type \"None\" cannot be used with \"with\"",
355
- "noneOperator": "Operator \"{operator}\" not supported for \"None\"",
356
- "noneUnknownMember": "\"{name}\" is not a known attribute of \"None\"",
357
- "notRequiredArgCount": "Expected a single type argument after \"NotRequired\"",
358
- "notRequiredNotInTypedDict": "\"NotRequired\" is not allowed in this context",
815
+ "nonLocalInModule": {
816
+ "message": "Nonlocal declaration not allowed at module level",
817
+ "comment": ["{StrContains=i'nonlocal'}", "'nonlocal' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
818
+ },
819
+ "nonLocalNoBinding": {
820
+ "message": "No binding for nonlocal \"{name}\" found",
821
+ "comment": ["{Locked='nonlocal'}", "'No binding found' means that Pyright couldn't resolve the variable name to an object"]
822
+ },
823
+ "nonLocalReassignment": {
824
+ "message": "\"{name}\" is assigned before nonlocal declaration",
825
+ "comment": "{Locked='nonlocal'}"
826
+ },
827
+ "nonLocalRedefinition": {
828
+ "message": "\"{name}\" was already declared nonlocal",
829
+ "comment": "{Locked='nonlocal'}"
830
+ },
831
+ "noneNotCallable": {
832
+ "message": "Object of type \"None\" cannot be called",
833
+ "comment": "{Locked='None'}"
834
+ },
835
+ "noneNotIterable": {
836
+ "message": "Object of type \"None\" cannot be used as iterable value",
837
+ "comment": "{Locked='None'}"
838
+ },
839
+ "noneNotSubscriptable": {
840
+ "message": "Object of type \"None\" is not subscriptable",
841
+ "comment": "{Locked='None'}"
842
+ },
843
+ "noneNotUsableWith": {
844
+ "message": "Object of type \"None\" cannot be used with \"with\"",
845
+ "comment": "{Locked='None','with'}"
846
+ },
847
+ "noneOperator": {
848
+ "message": "Operator \"{operator}\" not supported for \"None\"",
849
+ "comment": "{Locked='None'}"
850
+ },
851
+ "noneUnknownMember": {
852
+ "message": "\"{name}\" is not a known attribute of \"None\"",
853
+ "comment": "{Locked='None'}"
854
+ },
855
+ "notRequiredArgCount": {
856
+ "message": "Expected a single type argument after \"NotRequired\"",
857
+ "comment": "{Locked='NotRequired'}"
858
+ },
859
+ "notRequiredNotInTypedDict": {
860
+ "message": "\"NotRequired\" is not allowed in this context",
861
+ "comment": "{Locked='NotRequired'}"
862
+ },
359
863
  "objectNotCallable": "Object of type \"{type}\" is not callable",
360
864
  "obscuredClassDeclaration": "Class declaration \"{name}\" is obscured by a declaration of the same name",
361
865
  "obscuredFunctionDeclaration": "Function declaration \"{name}\" is obscured by a declaration of the same name",
@@ -364,43 +868,112 @@
364
868
  "obscuredTypeAliasDeclaration": "Type alias declaration \"{name}\" is obscured by a declaration of the same name",
365
869
  "obscuredVariableDeclaration": "Declaration \"{name}\" is obscured by a declaration of the same name",
366
870
  "operatorLessOrGreaterDeprecated": "Operator \"<>\" is not supported in Python 3; use \"!=\" instead",
367
- "optionalExtraArgs": "Expected one type argument after \"Optional\"",
368
- "orPatternIrrefutable": "Irrefutable pattern allowed only as the last subpattern in an \"or\" pattern",
369
- "orPatternMissingName": "All subpatterns within an \"or\" pattern must target the same names",
871
+ "optionalExtraArgs": {
872
+ "message": "Expected one type argument after \"Optional\"",
873
+ "comment": "{Locked='Optional'}"
874
+ },
875
+ "orPatternIrrefutable": {
876
+ "message": "Irrefutable pattern allowed only as the last subpattern in an \"or\" pattern",
877
+ "comment": "{Locked='or'}"
878
+ },
879
+ "orPatternMissingName": {
880
+ "message": "All subpatterns within an \"or\" pattern must target the same names",
881
+ "comment": "{Locked='or'}"
882
+ },
370
883
  "overlappingKeywordArgs": "Typed dictionary overlaps with keyword parameter: {names}",
371
884
  "overlappingOverload": "Overload {obscured} for \"{name}\" will never be used because its parameters overlap overload {obscuredBy}",
372
885
  "overloadAbstractImplMismatch": "Overloads must match abstract status of implementation",
373
886
  "overloadAbstractMismatch": "Overloads must all be abstract or not",
374
- "overloadClassMethodInconsistent": "Overloads for \"{name}\" use @classmethod inconsistently",
375
- "overloadFinalInconsistencyImpl": "Overload for \"{name}\" is marked @final but implementation is not",
376
- "overloadFinalInconsistencyNoImpl": "Overload {index} for \"{name}\" is marked @final but overload 1 is not",
887
+ "overloadClassMethodInconsistent": {
888
+ "message": "Overloads for \"{name}\" use @classmethod inconsistently",
889
+ "comment": "{Locked='@classmethod'}"
890
+ },
891
+ "overloadFinalInconsistencyImpl": {
892
+ "message": "Overload for \"{name}\" is marked @final but implementation is not",
893
+ "comment": "{Locked='@final'}"
894
+ },
895
+ "overloadFinalInconsistencyNoImpl": {
896
+ "message": "Overload {index} for \"{name}\" is marked @final but overload 1 is not",
897
+ "comment": "{Locked='@final'}"
898
+ },
377
899
  "overloadImplementationMismatch": "Overloaded implementation is not consistent with signature of overload {index}",
378
900
  "overloadReturnTypeMismatch": "Overload {prevIndex} for \"{name}\" overlaps overload {newIndex} and returns an incompatible type",
379
- "overloadStaticMethodInconsistent": "Overloads for \"{name}\" use @staticmethod inconsistently",
380
- "overloadWithoutImplementation": "\"{name}\" is marked as overload, but no implementation is provided",
381
- "overriddenMethodNotFound": "Method \"{name}\" is marked as override, but no base method of same name is present",
382
- "overrideDecoratorMissing": "Method \"{name}\" is not marked as override but is overriding a method in class \"{className}\"",
901
+ "overloadStaticMethodInconsistent": {
902
+ "message": "Overloads for \"{name}\" use @staticmethod inconsistently",
903
+ "comment": "{Locked='@staticmethod'}"
904
+ },
905
+ "overloadWithoutImplementation": {
906
+ "message": "\"{name}\" is marked as overload, but no implementation is provided",
907
+ "comment": "{Locked='overload'}"
908
+ },
909
+ "overriddenMethodNotFound": {
910
+ "message": "Method \"{name}\" is marked as override, but no base method of same name is present",
911
+ "comment": "{Locked='override'}"
912
+ },
913
+ "overrideDecoratorMissing": {
914
+ "message": "Method \"{name}\" is not marked as override but is overriding a method in class \"{className}\"",
915
+ "comment": "{Locked='override'}"
916
+ },
383
917
  "paramAfterKwargsParam": "Parameter cannot follow \"**\" parameter",
384
918
  "paramAlreadyAssigned": "Parameter \"{name}\" is already assigned",
385
919
  "paramAnnotationMissing": "Type annotation is missing for parameter \"{name}\"",
386
920
  "paramAssignmentMismatch": "Expression of type \"{sourceType}\" cannot be assigned to parameter of type \"{paramType}\"",
387
921
  "paramNameMissing": "No parameter named \"{name}\"",
388
- "paramSpecArgsKwargsUsage": "\"args\" and \"kwargs\" attributes of ParamSpec must both appear within a function signature",
389
- "paramSpecArgsMissing": "Arguments for ParamSpec \"{type}\" are missing",
390
- "paramSpecArgsUsage": "\"args\" attribute of ParamSpec is valid only when used with *args parameter",
391
- "paramSpecAssignedName": "ParamSpec must be assigned to a variable named \"{name}\"",
392
- "paramSpecContext": "ParamSpec is not allowed in this context",
393
- "paramSpecDefaultNotTuple": "Expected ellipsis, a tuple expression, or ParamSpec for default value of ParamSpec",
394
- "paramSpecFirstArg": "Expected name of ParamSpec as first argument",
395
- "paramSpecKwargsUsage": "\"kwargs\" attribute of ParamSpec is valid only when used with **kwargs parameter",
396
- "paramSpecNotUsedByOuterScope": "ParamSpec \"{name}\" has no meaning in this context",
397
- "paramSpecUnknownArg": "ParamSpec does not support more than one argument",
398
- "paramSpecUnknownMember": "\"{name}\" is not a known attribute of ParamSpec",
399
- "paramSpecUnknownParam": "\"{name}\" is unknown parameter to ParamSpec",
922
+ "paramSpecArgsKwargsUsage": {
923
+ "message": "\"args\" and \"kwargs\" attributes of ParamSpec must both appear within a function signature",
924
+ "comment": "{Locked='args','kwargs','ParamSpec'}"
925
+ },
926
+ "paramSpecArgsMissing": {
927
+ "message": "Arguments for ParamSpec \"{type}\" are missing",
928
+ "comment": "{Locked='ParamSpec'}"
929
+ },
930
+ "paramSpecArgsUsage": {
931
+ "message": "\"args\" attribute of ParamSpec is valid only when used with *args parameter",
932
+ "comment": "{Locked='args','ParamSpec','*args'}"
933
+ },
934
+ "paramSpecAssignedName": {
935
+ "message": "ParamSpec must be assigned to a variable named \"{name}\"",
936
+ "comment": "{Locked='ParamSpec'}"
937
+ },
938
+ "paramSpecContext": {
939
+ "message": "ParamSpec is not allowed in this context",
940
+ "comment": "{Locked='ParamSpec'}"
941
+ },
942
+ "paramSpecDefaultNotTuple": {
943
+ "message": "Expected ellipsis, a tuple expression, or ParamSpec for default value of ParamSpec",
944
+ "comment": "{Locked='tuple','ParamSpec'}"
945
+ },
946
+ "paramSpecFirstArg": {
947
+ "message": "Expected name of ParamSpec as first argument",
948
+ "comment": "{Locked='ParamSpec'}"
949
+ },
950
+ "paramSpecKwargsUsage": {
951
+ "message": "\"kwargs\" attribute of ParamSpec is valid only when used with **kwargs parameter",
952
+ "comment": "{Locked='kwargs','ParamSpec','**kwargs'}"
953
+ },
954
+ "paramSpecNotUsedByOuterScope": {
955
+ "message": "ParamSpec \"{name}\" has no meaning in this context",
956
+ "comment": "{Locked='ParamSpec'}"
957
+ },
958
+ "paramSpecUnknownArg": {
959
+ "message": "ParamSpec does not support more than one argument",
960
+ "comment": "{Locked='ParamSpec'}"
961
+ },
962
+ "paramSpecUnknownMember": {
963
+ "message": "\"{name}\" is not a known attribute of ParamSpec",
964
+ "comment": "{Locked='ParamSpec'}"
965
+ },
966
+ "paramSpecUnknownParam": {
967
+ "message": "\"{name}\" is unknown parameter to ParamSpec",
968
+ "comment": "{Locked='ParamSpec'}"
969
+ },
400
970
  "paramTypeCovariant": "Covariant type variable cannot be used in parameter type",
401
971
  "paramTypePartiallyUnknown": "Type of parameter \"{paramName}\" is partially unknown",
402
972
  "paramTypeUnknown": "Type of parameter \"{paramName}\" is unknown",
403
- "parenthesizedContextManagerIllegal": "Parentheses within \"with\" statement requires Python 3.9 or newer",
973
+ "parenthesizedContextManagerIllegal": {
974
+ "message": "Parentheses within \"with\" statement requires Python 3.9 or newer",
975
+ "comment": "{Locked='with'}"
976
+ },
404
977
  "patternNeverMatches": "Pattern will never be matched for subject type \"{type}\"",
405
978
  "positionArgAfterNamedArg": "Positional argument cannot appear after keyword arguments",
406
979
  "positionOnlyAfterArgs": "Position-only parameter separator not allowed after \"*\" parameter",
@@ -411,112 +984,322 @@
411
984
  "privateImportFromPyTypedModule": "\"{name}\" is not exported from module \"{module}\"",
412
985
  "privateUsedOutsideOfClass": "\"{name}\" is private and used outside of the class in which it is declared",
413
986
  "privateUsedOutsideOfModule": "\"{name}\" is private and used outside of the module in which it is declared",
414
- "propertyOverridden": "\"{name}\" incorrectly overrides property of same name in class \"{className}\"",
415
- "propertyStaticMethod": "Static methods not allowed for property getter, setter or deleter",
987
+ "propertyOverridden": {
988
+ "message": "\"{name}\" incorrectly overrides property of same name in class \"{className}\"",
989
+ "comment": "{Locked='property'}"
990
+ },
991
+ "propertyStaticMethod": {
992
+ "message": "Static methods not allowed for property getter, setter or deleter",
993
+ "comment": "{Locked='property','getter','setter','deleter'}"
994
+ },
416
995
  "protectedUsedOutsideOfClass": "\"{name}\" is protected and used outside of the class in which it is declared",
417
- "protocolBaseClass": "Protocol class \"{classType}\" cannot derive from non-protocol class \"{baseType}\"",
418
- "protocolBaseClassWithTypeArgs": "Type arguments are not allowed with Protocol class when using type parameter syntax",
419
- "protocolIllegal": "Use of \"Protocol\" requires Python 3.7 or newer",
420
- "protocolNotAllowed": "\"Protocol\" cannot be used in this context",
421
- "protocolTypeArgMustBeTypeParam": "Type argument for \"Protocol\" must be a type parameter",
996
+ "protocolBaseClass": {
997
+ "message": "Protocol class \"{classType}\" cannot derive from non-Protocol class \"{baseType}\"",
998
+ "comment": "{Locked='Protocol'}"
999
+ },
1000
+ "protocolBaseClassWithTypeArgs": {
1001
+ "message": "Type arguments are not allowed with Protocol class when using type parameter syntax",
1002
+ "comment": "{Locked='Protocol'}"
1003
+ },
1004
+ "protocolIllegal": {
1005
+ "message": "Use of \"Protocol\" requires Python 3.7 or newer",
1006
+ "comment": "{Locked='Protocol'}"
1007
+ },
1008
+ "protocolNotAllowed": {
1009
+ "message": "\"Protocol\" cannot be used in this context",
1010
+ "comment": "{Locked='Protocol'}"
1011
+ },
1012
+ "protocolTypeArgMustBeTypeParam": {
1013
+ "message": "Type argument for \"Protocol\" must be a type parameter",
1014
+ "comment": "{Locked='Protocol'}"
1015
+ },
422
1016
  "protocolUnsafeOverlap": "Class overlaps \"{name}\" unsafely and could produce a match at runtime",
423
- "protocolVarianceContravariant": "Type variable \"{variable}\" used in generic protocol \"{class}\" should be contravariant",
424
- "protocolVarianceCovariant": "Type variable \"{variable}\" used in generic protocol \"{class}\" should be covariant",
425
- "protocolVarianceInvariant": "Type variable \"{variable}\" used in generic protocol \"{class}\" should be invariant",
426
- "pyrightCommentInvalidDiagnosticBoolValue": "Pyright comment directive must be followed by \"=\" and a value of true or false",
427
- "pyrightCommentInvalidDiagnosticSeverityValue": "Pyright comment directive must be followed by \"=\" and a value of true, false, error, warning, information, or none",
428
- "pyrightCommentMissingDirective": "Pyright comment must be followed by a directive (basic or strict) or a diagnostic rule",
429
- "pyrightCommentNotOnOwnLine": "Pyright comments used to control file-level settings must appear on their own line",
430
- "pyrightCommentUnknownDiagnosticRule": "\"{rule}\" is an unknown diagnostic rule for pyright comment",
431
- "pyrightCommentUnknownDiagnosticSeverityValue": "\"{value}\" is invalid value for pyright comment; expected true, false, error, warning, information, or none",
432
- "pyrightCommentUnknownDirective": "\"{directive}\" is an unknown directive for pyright comment; expected \"strict\" or \"basic\"",
433
- "readOnlyArgCount": "Expected a single type argument after \"ReadOnly\"",
434
- "readOnlyNotInTypedDict": "\"ReadOnly\" is not allowed in this context",
1017
+ "protocolVarianceContravariant": {
1018
+ "message": "Type variable \"{variable}\" used in generic Protocol \"{class}\" should be contravariant",
1019
+ "comment": ["{Locked='Protocol'}", "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"]
1020
+ },
1021
+ "protocolVarianceCovariant": {
1022
+ "message": "Type variable \"{variable}\" used in generic Protocol \"{class}\" should be covariant",
1023
+ "comment": ["{Locked='Protocol'}", "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"]
1024
+ },
1025
+ "protocolVarianceInvariant": {
1026
+ "message": "Type variable \"{variable}\" used in generic Protocol \"{class}\" should be invariant",
1027
+ "comment": ["{Locked='Protocol'}", "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"]
1028
+ },
1029
+ "pyrightCommentInvalidDiagnosticBoolValue": {
1030
+ "message": "Pyright comment directive must be followed by \"=\" and a value of true or false",
1031
+ "comment": "{Locked='Pyright','true','false'}"
1032
+ },
1033
+ "pyrightCommentInvalidDiagnosticSeverityValue": {
1034
+ "message": "Pyright comment directive must be followed by \"=\" and a value of true, false, error, warning, information, or none",
1035
+ "comment": "{Locked='Pyright','true','false','error','warning','information','none'}"
1036
+ },
1037
+ "pyrightCommentMissingDirective": {
1038
+ "message": "Pyright comment must be followed by a directive (basic or strict) or a diagnostic rule",
1039
+ "comment": "{Locked='Pyright','basic','strict'}"
1040
+ },
1041
+ "pyrightCommentNotOnOwnLine": {
1042
+ "message": "Pyright comments used to control file-level settings must appear on their own line",
1043
+ "comment": "{Locked='Pyright'}"
1044
+ },
1045
+ "pyrightCommentUnknownDiagnosticRule": {
1046
+ "message": "\"{rule}\" is an unknown diagnostic rule for pyright comment",
1047
+ "comment": "{Locked='pyright'}"
1048
+ },
1049
+ "pyrightCommentUnknownDiagnosticSeverityValue": {
1050
+ "message": "\"{value}\" is invalid value for pyright comment; expected true, false, error, warning, information, or none",
1051
+ "comment": "{Locked='pyright','true','false','error','warning','information','none'}"
1052
+ },
1053
+ "pyrightCommentUnknownDirective": {
1054
+ "message": "\"{directive}\" is an unknown directive for pyright comment; expected \"strict\" or \"basic\"",
1055
+ "comment": "{Locked='pyright','strict','basic'}"
1056
+ },
1057
+ "readOnlyArgCount": {
1058
+ "message": "Expected a single type argument after \"ReadOnly\"",
1059
+ "comment": "{Locked='ReadOnly'}"
1060
+ },
1061
+ "readOnlyNotInTypedDict": {
1062
+ "message": "\"ReadOnly\" is not allowed in this context",
1063
+ "comment": "{Locked='ReadOnly'}"
1064
+ },
435
1065
  "recursiveDefinition": "Type of \"{name}\" could not be determined because it refers to itself",
436
- "relativeImportNotAllowed": "Relative imports cannot be used with \"import .a\" form; use \"from . import a\" instead",
437
- "requiredArgCount": "Expected a single type argument after \"Required\"",
438
- "requiredNotInTypedDict": "\"Required\" is not allowed in this context",
439
- "returnInAsyncGenerator": "Return statement with value is not allowed in async generator",
1066
+ "relativeImportNotAllowed": {
1067
+ "message": "Relative imports cannot be used with \"import .a\" form; use \"from . import a\" instead",
1068
+ "comment": "{Locked='import .a','from . import a'}"
1069
+ },
1070
+ "requiredArgCount": {
1071
+ "message": "Expected a single type argument after \"Required\"",
1072
+ "comment": "{Locked='Required'}"
1073
+ },
1074
+ "requiredNotInTypedDict": {
1075
+ "message": "\"Required\" is not allowed in this context",
1076
+ "comment": "{Locked='Required'}"
1077
+ },
1078
+ "returnInAsyncGenerator": {
1079
+ "message": "Return statement with value is not allowed in async generator",
1080
+ "comment": "{Locked='async'}"
1081
+ },
440
1082
  "returnMissing": "Function with declared return type \"{returnType}\" must return value on all code paths",
441
- "returnOutsideFunction": "\"return\" can be used only within a function",
1083
+ "returnOutsideFunction": {
1084
+ "message": "\"return\" can be used only within a function",
1085
+ "comment": "{Locked='return'}"
1086
+ },
442
1087
  "returnTypeContravariant": "Contravariant type variable cannot be used in return type",
443
1088
  "returnTypeMismatch": "Type \"{exprType}\" is not assignable to return type \"{returnType}\"",
444
1089
  "returnTypePartiallyUnknown": "Return type, \"{returnType}\", is partially unknown",
445
1090
  "returnTypeUnknown": "Return type is unknown",
446
- "revealLocalsArgs": "Expected no arguments for \"reveal_locals\" call",
447
- "revealLocalsNone": "No locals in this scope",
448
- "revealTypeArgs": "Expected a single positional argument for \"reveal_type\" call",
449
- "revealTypeExpectedTextArg": "The \"expected_text\" argument for function \"reveal_type\" must be a str literal value",
1091
+ "revealLocalsArgs": {
1092
+ "message": "Expected no arguments for \"reveal_locals\" call",
1093
+ "comment": "{Locked='reveal_locals'}"
1094
+ },
1095
+ "revealLocalsNone": {
1096
+ "message": "No locals in this scope",
1097
+ "comment": "{Locked='locals'}"
1098
+ },
1099
+ "revealTypeArgs": {
1100
+ "message": "Expected a single positional argument for \"reveal_type\" call",
1101
+ "comment": "{Locked='reveal_type'}"
1102
+ },
1103
+ "revealTypeExpectedTextArg": {
1104
+ "message": "The \"expected_text\" argument for function \"reveal_type\" must be a str literal value",
1105
+ "comment": "{Locked='expected_text','reveal_type','str'}"
1106
+ },
450
1107
  "revealTypeExpectedTextMismatch": "Type text mismatch; expected \"{expected}\" but received \"{received}\"",
451
1108
  "revealTypeExpectedTypeMismatch": "Type mismatch; expected \"{expected}\" but received \"{received}\"",
452
- "selfTypeContext": "\"Self\" is not valid in this context",
453
- "selfTypeMetaclass": "\"Self\" cannot be used within a metaclass (a subclass of \"type\")",
454
- "selfTypeWithTypedSelfOrCls": "\"Self\" cannot be used in a function with a `self` or `cls` parameter that has a type annotation other than \"Self\"",
455
- "setterGetterTypeMismatch": "Property setter value type is not assignable to the getter return type",
1109
+ "selfTypeContext": {
1110
+ "message": "\"Self\" is not valid in this context",
1111
+ "comment": "{Locked='Self'}"
1112
+ },
1113
+ "selfTypeMetaclass": {
1114
+ "message": "\"Self\" cannot be used within a metaclass (a subclass of \"type\")",
1115
+ "comment": ["{Locked='Self'}", "Metaclasses are a complex concept and it may be best to not localize the term"]
1116
+ },
1117
+ "selfTypeWithTypedSelfOrCls": {
1118
+ "message": "\"Self\" cannot be used in a function with a `self` or `cls` parameter that has a type annotation other than \"Self\"",
1119
+ "comment": "{Locked='Self','self','cls'}"
1120
+ },
1121
+ "setterGetterTypeMismatch": {
1122
+ "message": "Property setter value type is not assignable to the getter return type",
1123
+ "comment": ["{Locked='setter','getter'}", "{StrContains=i'property'}", "'property' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1124
+ },
456
1125
  "singleOverload": "\"{name}\" is marked as overload, but additional overloads are missing",
457
- "slotsAttributeError": "\"{name}\" is not specified in __slots__",
458
- "slotsClassVarConflict": "\"{name}\" conflicts with instance variable declared in __slots__",
459
- "starPatternInAsPattern": "Star pattern cannot be used with \"as\" target",
460
- "starPatternInOrPattern": "Star pattern cannot be ORed within other patterns",
1126
+ "slotsAttributeError": {
1127
+ "message": "\"{name}\" is not specified in __slots__",
1128
+ "comment": "{Locked='__slots__'}"
1129
+ },
1130
+ "slotsClassVarConflict": {
1131
+ "message": "\"{name}\" conflicts with instance variable declared in __slots__",
1132
+ "comment": "{Locked='__slots__'}"
1133
+ },
1134
+ "starPatternInAsPattern": {
1135
+ "message": "Star pattern cannot be used with \"as\" target",
1136
+ "comment": ["{Locked='as'}", "Star pattern refers to the use of the * (star) character to represent a variable length pattern match"]
1137
+ },
1138
+ "starPatternInOrPattern": {
1139
+ "message": "Star pattern cannot be ORed within other patterns",
1140
+ "comment": ["Star pattern refers to the use of the * (star) character to represent a variable length pattern match", "'ORed' means joined together with a binary 'or' operation"]
1141
+ },
461
1142
  "starStarWildcardNotAllowed": "** cannot be used with wildcard \"_\"",
462
- "staticClsSelfParam": "Static methods should not take a \"self\" or \"cls\" parameter",
463
- "stdlibModuleOverridden": "\"{path}\" is overriding the stdlib module \"{name}\"",
464
- "stringNonAsciiBytes": "Non-ASCII character not allowed in bytes string literal",
1143
+ "staticClsSelfParam": {
1144
+ "message": "Static methods should not take a \"self\" or \"cls\" parameter",
1145
+ "comment": "{Locked='self','cls'}"
1146
+ },
1147
+ "stdlibModuleOverridden": {
1148
+ "message": "\"{path}\" is overriding the stdlib module \"{name}\"",
1149
+ "comment": "{Locked='stdlib'}"
1150
+ },
1151
+ "stringNonAsciiBytes": {
1152
+ "message": "Non-ASCII character not allowed in bytes string literal",
1153
+ "comment": "{Locked='ASCII'}"
1154
+ },
465
1155
  "stringNotSubscriptable": "String expression cannot be subscripted in type expression; enclose entire expression in quotes",
466
1156
  "stringUnsupportedEscape": "Unsupported escape sequence in string literal",
467
1157
  "stringUnterminated": "String literal is unterminated",
468
- "stubFileMissing": "Stub file not found for \"{importName}\"",
469
- "stubUsesGetAttr": "Type stub file is incomplete; \"__getattr__\" obscures type errors for module",
470
- "sublistParamsIncompatible": "Sublist parameters are not supported in Python 3.x",
471
- "superCallArgCount": "Expected no more than two arguments to \"super\" call",
472
- "superCallFirstArg": "Expected class type as first argument to \"super\" call but received \"{type}\"",
473
- "superCallSecondArg": "Second argument to \"super\" call must be object or class that derives from \"{type}\"",
474
- "superCallZeroArgForm": "Zero-argument form of \"super\" call is valid only within a method",
475
- "superCallZeroArgFormStaticMethod": "Zero-argument form of \"super\" call is not valid within a static method",
1158
+ "stubFileMissing": {
1159
+ "message": "Stub file not found for \"{importName}\"",
1160
+ "comment": "{StrContains=i'stub'}"
1161
+ },
1162
+ "stubUsesGetAttr": {
1163
+ "message": "Type stub file is incomplete; \"__getattr__\" obscures type errors for module",
1164
+ "comment": ["{Locked='__getattr__'}", "{StrContains=i'stub'}"]
1165
+ },
1166
+ "sublistParamsIncompatible": {
1167
+ "message": "Sublist parameters are not supported in Python 3.x",
1168
+ "comment": "{StrContains=i'sublist'}"
1169
+ },
1170
+ "superCallArgCount": {
1171
+ "message": "Expected no more than two arguments to \"super\" call",
1172
+ "comment": "{Locked='super'}"
1173
+ },
1174
+ "superCallFirstArg": {
1175
+ "message": "Expected class type as first argument to \"super\" call but received \"{type}\"",
1176
+ "comment": "{Locked='super'}"
1177
+ },
1178
+ "superCallSecondArg": {
1179
+ "message": "Second argument to \"super\" call must be object or class that derives from \"{type}\"",
1180
+ "comment": "{Locked='super'}"
1181
+ },
1182
+ "superCallZeroArgForm": {
1183
+ "message": "Zero-argument form of \"super\" call is valid only within a method",
1184
+ "comment": "{Locked='super'}"
1185
+ },
1186
+ "superCallZeroArgFormStaticMethod": {
1187
+ "message": "Zero-argument form of \"super\" call is not valid within a static method",
1188
+ "comment": "{Locked='super'}"
1189
+ },
476
1190
  "symbolIsPossiblyUnbound": "\"{name}\" is possibly unbound",
477
1191
  "symbolIsUnbound": "\"{name}\" is unbound",
478
1192
  "symbolIsUndefined": "\"{name}\" is not defined",
479
1193
  "symbolOverridden": "\"{name}\" overrides symbol of same name in class \"{className}\"",
480
1194
  "ternaryNotAllowed": "Ternary expression not allowed in type expression",
481
- "totalOrderingMissingMethod": "Class must define one of \"__lt__\", \"__le__\", \"__gt__\", or \"__ge__\" to use total_ordering",
1195
+ "totalOrderingMissingMethod": {
1196
+ "message": "Class must define one of \"__lt__\", \"__le__\", \"__gt__\", or \"__ge__\" to use total_ordering",
1197
+ "comment": "{Locked='__lt__','__le__','__gt__','__ge__','total_ordering'}"
1198
+ },
482
1199
  "trailingCommaInFromImport": "Trailing comma not allowed without surrounding parentheses",
483
- "tryWithoutExcept": "Try statement must have at least one except or finally clause",
484
- "tupleAssignmentMismatch": "Expression with type \"{type}\" cannot be assigned to target tuple",
485
- "tupleInAnnotation": "Tuple expression not allowed in type expression",
1200
+ "tryWithoutExcept": {
1201
+ "message": "Try statement must have at least one except or finally clause",
1202
+ "comment": ["{Locked='except','finally'}", "{StrContains=i'try'}", "'try' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1203
+ },
1204
+ "tupleAssignmentMismatch": {
1205
+ "message": "Expression with type \"{type}\" cannot be assigned to target tuple",
1206
+ "comment": "{Locked='tuple'}"
1207
+ },
1208
+ "tupleInAnnotation": {
1209
+ "message": "Tuple expression not allowed in type expression",
1210
+ "comment": ["{StrContains=i'tuple'}", "'tuple' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1211
+ },
486
1212
  "tupleIndexOutOfRange": "Index {index} is out of range for type {type}",
487
1213
  "typeAliasIllegalExpressionForm": "Invalid expression form for type alias definition",
488
1214
  "typeAliasIsRecursiveDirect": "Type alias \"{name}\" cannot use itself in its definition",
489
- "typeAliasNotInModuleOrClass": "A TypeAlias can be defined only within a module or class scope",
490
- "typeAliasRedeclared": "\"{name}\" is declared as a TypeAlias and can be assigned only once",
491
- "typeAliasStatementBadScope": "A type statement can be used only within a module or class scope",
1215
+ "typeAliasNotInModuleOrClass": {
1216
+ "message": "A TypeAlias can be defined only within a module or class scope",
1217
+ "comment": "{Locked='TypeAlias'}"
1218
+ },
1219
+ "typeAliasRedeclared": {
1220
+ "message": "\"{name}\" is declared as a TypeAlias and can be assigned only once",
1221
+ "comment": "{Locked='TypeAlias'}"
1222
+ },
1223
+ "typeAliasStatementBadScope": {
1224
+ "message": "A type statement can be used only within a module or class scope",
1225
+ "comment": "{Locked='type'}"
1226
+ },
492
1227
  "typeAliasStatementIllegal": "Type alias statement requires Python 3.12 or newer",
493
- "typeAliasTypeBaseClass": "A type alias defined in a \"type\" statement cannot be used as a base class",
494
- "typeAliasTypeMustBeAssigned": "TypeAliasType must be assigned to a variable with the same name as the type alias",
495
- "typeAliasTypeNameArg": "First argument to TypeAliasType must be a string literal representing the name of the type alias",
1228
+ "typeAliasTypeBaseClass": {
1229
+ "message": "A type alias defined in a \"type\" statement cannot be used as a base class",
1230
+ "comment": "{Locked='\"type\"'}"
1231
+ },
1232
+ "typeAliasTypeMustBeAssigned": {
1233
+ "message": "TypeAliasType must be assigned to a variable with the same name as the type alias",
1234
+ "comment": "{Locked='TypeAliasType'}"
1235
+ },
1236
+ "typeAliasTypeNameArg": {
1237
+ "message": "First argument to TypeAliasType must be a string literal representing the name of the type alias",
1238
+ "comment": "{Locked='TypeAliasType'}"
1239
+ },
496
1240
  "typeAliasTypeNameMismatch": "Name of type alias must match the name of the variable to which it is assigned",
497
- "typeAliasTypeParamInvalid": "Type parameter list must be a tuple containing only TypeVar, TypeVarTuple, or ParamSpec",
1241
+ "typeAliasTypeParamInvalid": {
1242
+ "message": "Type parameter list must be a tuple containing only TypeVar, TypeVarTuple, or ParamSpec",
1243
+ "comment": "{Locked='tuple','TypeVar','TypeVarTuple','ParamSpec'}"
1244
+ },
498
1245
  "typeAnnotationCall": "Call expression not allowed in type expression",
499
1246
  "typeAnnotationVariable": "Variable not allowed in type expression",
500
- "typeAnnotationWithCallable": "Type argument for \"type\" must be a class; callables are not supported",
501
- "typeArgListExpected": "Expected ParamSpec, ellipsis, or list of types",
502
- "typeArgListNotAllowed": "List expression not allowed for this type argument",
1247
+ "typeAnnotationWithCallable": {
1248
+ "message": "Type argument for \"type\" must be a class; callables are not supported",
1249
+ "comment": ["{Locked='type'}", "'callables' are objects that can be called like a function"]
1250
+ },
1251
+ "typeArgListExpected": {
1252
+ "message": "Expected ParamSpec, ellipsis, or list of types",
1253
+ "comment": "{Locked='ParamSpec','list'}"
1254
+ },
1255
+ "typeArgListNotAllowed": {
1256
+ "message": "List expression not allowed for this type argument",
1257
+ "comment": ["{StrContains=i'list'}", "'list' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1258
+ },
503
1259
  "typeArgsExpectingNone": "Expected no type arguments for class \"{name}\"",
504
1260
  "typeArgsMismatchOne": "Expected one type argument but received {received}",
505
- "typeArgsMissingForAlias": "Expected type arguments for generic type alias \"{name}\"",
506
- "typeArgsMissingForClass": "Expected type arguments for generic class \"{name}\"",
1261
+ "typeArgsMissingForAlias": {
1262
+ "message": "Expected type arguments for generic type alias \"{name}\"",
1263
+ "comment": "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"
1264
+ },
1265
+ "typeArgsMissingForClass": {
1266
+ "message": "Expected type arguments for generic class \"{name}\"",
1267
+ "comment": "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"
1268
+ },
507
1269
  "typeArgsTooFew": "Too few type arguments provided for \"{name}\"; expected {expected} but received {received}",
508
1270
  "typeArgsTooMany": "Too many type arguments provided for \"{name}\"; expected {expected} but received {received}",
509
1271
  "typeAssignmentMismatch": "Type \"{sourceType}\" is not assignable to declared type \"{destType}\"",
510
1272
  "typeAssignmentMismatchWildcard": "Import symbol \"{name}\" has type \"{sourceType}\", which is not assignable to declared type \"{destType}\"",
511
- "typeCallNotAllowed": "type() call should not be used in type expression",
512
- "typeCheckOnly": "\"{name}\" is marked as @type_check_only and can be used only in type annotations",
513
- "typeCommentDeprecated": "Use of type comments is deprecated; use type annotation instead",
1273
+ "typeCallNotAllowed": {
1274
+ "message": "type() call should not be used in type expression",
1275
+ "comment": "{Locked='type()'}"
1276
+ },
1277
+ "typeCheckOnly": {
1278
+ "message": "\"{name}\" is marked as @type_check_only and can be used only in type annotations",
1279
+ "comment": "{Locked='@type_check_only'}"
1280
+ },
1281
+ "typeCommentDeprecated": {
1282
+ "message": "Use of type comments is deprecated; use type annotation instead",
1283
+ "comment": "{Locked='type'}"
1284
+ },
514
1285
  "typeExpectedClass": "Expected class but received \"{type}\"",
515
- "typeFormArgs": "\"TypeForm\" accepts a single positional argument",
516
- "typeGuardArgCount": "Expected a single type argument after \"TypeGuard\" or \"TypeIs\"",
1286
+ "typeFormArgs": {
1287
+ "message": "\"TypeForm\" accepts a single positional argument",
1288
+ "comment": "{Locked='TypeForm'}"
1289
+ },
1290
+ "typeGuardArgCount": {
1291
+ "message": "Expected a single type argument after \"TypeGuard\" or \"TypeIs\"",
1292
+ "comment": "{Locked='TypeGuard','TypeIs'}"
1293
+ },
517
1294
  "typeGuardParamCount": "User-defined type guard functions and methods must have at least one input parameter",
518
- "typeIsReturnType": "Return type of TypeIs (\"{returnType}\") is not consistent with value parameter type (\"{type}\")",
519
- "typeNotAwaitable": "\"{type}\" is not awaitable",
1295
+ "typeIsReturnType": {
1296
+ "message": "Return type of TypeIs (\"{returnType}\") is not consistent with value parameter type (\"{type}\")",
1297
+ "comment": "{Locked='TypeIs'}"
1298
+ },
1299
+ "typeNotAwaitable": {
1300
+ "message": "\"{type}\" is not awaitable",
1301
+ "comment": "{Locked='awaitable'}"
1302
+ },
520
1303
  "typeNotIntantiable": "\"{type}\" cannot be instantiated",
521
1304
  "typeNotIterable": "\"{type}\" is not iterable",
522
1305
  "typeNotSpecializable": "Could not specialize type \"{type}\"",
@@ -526,62 +1309,182 @@
526
1309
  "typeNotSupportUnaryOperator": "Operator \"{operator}\" not supported for type \"{type}\"",
527
1310
  "typeNotSupportUnaryOperatorBidirectional": "Operator \"{operator}\" not supported for type \"{type}\" when expected type is \"{expectedType}\"",
528
1311
  "typeNotUsableWith": "Object of type \"{type}\" cannot be used with \"with\" because it does not implement {method}",
529
- "typeParameterBoundNotAllowed": "Bound or constraint cannot be used with a variadic type parameter or ParamSpec",
1312
+ "typeParameterBoundNotAllowed": {
1313
+ "message": "Bound or constraint cannot be used with a variadic type parameter or ParamSpec",
1314
+ "comment": ["{Locked='ParamSpec'}", "'variadic' means that it accepts a variable number of arguments"]
1315
+ },
530
1316
  "typeParameterConstraintTuple": "Type parameter constraint must be a tuple of two or more types",
531
1317
  "typeParameterExistingTypeParameter": "Type parameter \"{name}\" is already in use",
532
1318
  "typeParameterNotDeclared": "Type parameter \"{name}\" is not included in the type parameter list for \"{container}\"",
533
1319
  "typeParametersMissing": "At least one type parameter must be specified",
534
1320
  "typePartiallyUnknown": "Type of \"{name}\" is partially unknown",
535
1321
  "typeUnknown": "Type of \"{name}\" is unknown",
536
- "typeVarAssignedName": "TypeVar must be assigned to a variable named \"{name}\"",
1322
+ "typeVarAssignedName": {
1323
+ "message": "TypeVar must be assigned to a variable named \"{name}\"",
1324
+ "comment": "{Locked='TypeVar'}"
1325
+ },
537
1326
  "typeVarAssignmentMismatch": "Type \"{type}\" cannot be assigned to type variable \"{name}\"",
538
- "typeVarBoundAndConstrained": "TypeVar cannot be both bound and constrained",
539
- "typeVarBoundGeneric": "TypeVar bound type cannot be generic",
540
- "typeVarConstraintGeneric": "TypeVar constraint type cannot be generic",
541
- "typeVarDefaultBoundMismatch": "TypeVar default type must be a subtype of the bound type",
542
- "typeVarDefaultConstraintMismatch": "TypeVar default type must be one of the constrained types",
1327
+ "typeVarBoundAndConstrained": {
1328
+ "message": "TypeVar cannot be both bound and constrained",
1329
+ "comment": "{Locked='TypeVar'}"
1330
+ },
1331
+ "typeVarBoundGeneric": {
1332
+ "message": "TypeVar bound type cannot be generic",
1333
+ "comment": ["{Locked='TypeVar'}", "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"]
1334
+ },
1335
+ "typeVarConstraintGeneric": {
1336
+ "message": "TypeVar constraint type cannot be generic",
1337
+ "comment": ["{Locked='TypeVar'}", "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"]
1338
+ },
1339
+ "typeVarDefaultBoundMismatch": {
1340
+ "message": "TypeVar default type must be a subtype of the bound type",
1341
+ "comment": "{Locked='TypeVar'}"
1342
+ },
1343
+ "typeVarDefaultConstraintMismatch": {
1344
+ "message": "TypeVar default type must be one of the constrained types",
1345
+ "comment": "{Locked='TypeVar'}"
1346
+ },
543
1347
  "typeVarDefaultIllegal": "Type variable default types require Python 3.13 or newer",
544
1348
  "typeVarDefaultInvalidTypeVar": "Type parameter \"{name}\" has a default type that refers to one or more type variables that are out of scope",
545
- "typeVarFirstArg": "Expected name of TypeVar as first argument",
1349
+ "typeVarFirstArg": {
1350
+ "message": "Expected name of TypeVar as first argument",
1351
+ "comment": "{Locked='TypeVar'}"
1352
+ },
546
1353
  "typeVarInvalidForMemberVariable": "Attribute type cannot use type variable \"{name}\" scoped to local method",
547
- "typeVarNoMember": "TypeVar \"{type}\" has no attribute \"{name}\"",
548
- "typeVarNotSubscriptable": "TypeVar \"{type}\" is not subscriptable",
1354
+ "typeVarNoMember": {
1355
+ "message": "TypeVar \"{type}\" has no attribute \"{name}\"",
1356
+ "comment": "{Locked='TypeVar'}"
1357
+ },
1358
+ "typeVarNotSubscriptable": {
1359
+ "message": "TypeVar \"{type}\" is not subscriptable",
1360
+ "comment": "{Locked='TypeVar'}"
1361
+ },
549
1362
  "typeVarNotUsedByOuterScope": "Type variable \"{name}\" has no meaning in this context",
550
1363
  "typeVarPossiblyUnsolvable": "Type variable \"{name}\" may go unsolved if caller supplies no argument for parameter \"{param}\"",
551
- "typeVarSingleConstraint": "TypeVar must have at least two constrained types",
552
- "typeVarTupleConstraints": "TypeVarTuple cannot have value constraints",
553
- "typeVarTupleContext": "TypeVarTuple is not allowed in this context",
554
- "typeVarTupleDefaultNotUnpacked": "TypeVarTuple default type must be an unpacked tuple or TypeVarTuple",
555
- "typeVarTupleMustBeUnpacked": "Unpack operator is required for TypeVarTuple value",
556
- "typeVarTupleUnknownParam": "\"{name}\" is unknown parameter to TypeVarTuple",
557
- "typeVarUnknownParam": "\"{name}\" is unknown parameter to TypeVar",
558
- "typeVarUsedByOuterScope": "TypeVar \"{name}\" is already in use by an outer scope",
559
- "typeVarUsedOnlyOnce": "TypeVar \"{name}\" appears only once in generic function signature",
560
- "typeVarVariance": "TypeVar cannot be both covariant and contravariant",
561
- "typeVarWithDefaultFollowsVariadic": "TypeVar \"{typeVarName}\" has a default value and cannot follow TypeVarTuple \"{variadicName}\"",
1364
+ "typeVarSingleConstraint": {
1365
+ "message": "TypeVar must have at least two constrained types",
1366
+ "comment": "{Locked='TypeVar'}"
1367
+ },
1368
+ "typeVarTupleConstraints": {
1369
+ "message": "TypeVarTuple cannot have value constraints",
1370
+ "comment": "{Locked='TypeVarTuple'}"
1371
+ },
1372
+ "typeVarTupleContext": {
1373
+ "message": "TypeVarTuple is not allowed in this context",
1374
+ "comment": "{Locked='TypeVarTuple'}"
1375
+ },
1376
+ "typeVarTupleDefaultNotUnpacked": {
1377
+ "message": "TypeVarTuple default type must be an unpacked tuple or TypeVarTuple",
1378
+ "comment": "{Locked='TypeVarTuple','tuple'}"
1379
+ },
1380
+ "typeVarTupleMustBeUnpacked": {
1381
+ "message": "Unpack operator is required for TypeVarTuple value",
1382
+ "comment": "{Locked='TypeVarTuple'}"
1383
+ },
1384
+ "typeVarTupleUnknownParam": {
1385
+ "message": "\"{name}\" is unknown parameter to TypeVarTuple",
1386
+ "comment": "{Locked='TypeVarTuple'}"
1387
+ },
1388
+ "typeVarUnknownParam": {
1389
+ "message": "\"{name}\" is unknown parameter to TypeVar",
1390
+ "comment": "{Locked='TypeVar'}"
1391
+ },
1392
+ "typeVarUsedByOuterScope": {
1393
+ "message": "TypeVar \"{name}\" is already in use by an outer scope",
1394
+ "comment": "{Locked='TypeVar'}"
1395
+ },
1396
+ "typeVarUsedOnlyOnce": {
1397
+ "message": "TypeVar \"{name}\" appears only once in generic function signature",
1398
+ "comment": ["{Locked='TypeVar'}", "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"]
1399
+ },
1400
+ "typeVarVariance": {
1401
+ "message": "TypeVar cannot be both covariant and contravariant",
1402
+ "comment": "{Locked='TypeVar'}"
1403
+ },
1404
+ "typeVarWithDefaultFollowsVariadic": {
1405
+ "message": "TypeVar \"{typeVarName}\" has a default value and cannot follow TypeVarTuple \"{variadicName}\"",
1406
+ "comment": "{Locked='TypeVar','TypeVarTuple'}"
1407
+ },
562
1408
  "typeVarWithoutDefault": "\"{name}\" cannot appear after \"{other}\" in type parameter list because it has no default type",
563
- "typeVarsNotInGenericOrProtocol": "Generic[] or Protocol[] must include all type variables",
564
- "typedDictAccess": "Could not access item in TypedDict",
565
- "typedDictAssignedName": "TypedDict must be assigned to a variable named \"{name}\"",
566
- "typedDictBadVar": "TypedDict classes can contain only type annotations",
567
- "typedDictBaseClass": "All base classes for TypedDict classes must also be TypedDict classes",
568
- "typedDictBoolParam": "Expected \"{name}\" parameter to have a value of True or False",
569
- "typedDictClosedExtras": "Base class \"{name}\" is a closed TypedDict; extra items must be type \"{type}\"",
570
- "typedDictClosedNoExtras": "Base class \"{name}\" is a closed TypedDict; extra items are not allowed",
571
- "typedDictDelete": "Could not delete item in TypedDict",
572
- "typedDictEmptyName": "Names within a TypedDict cannot be empty",
1409
+ "typeVarsNotInGenericOrProtocol": {
1410
+ "message": "Generic[] or Protocol[] must include all type variables",
1411
+ "comment": "{Locked='Generic[]','Protocol[]'}"
1412
+ },
1413
+ "typedDictAccess": {
1414
+ "message": "Could not access item in TypedDict",
1415
+ "comment": "{Locked='TypedDict'}"
1416
+ },
1417
+ "typedDictAssignedName": {
1418
+ "message": "TypedDict must be assigned to a variable named \"{name}\"",
1419
+ "comment": "{Locked='TypedDict'}"
1420
+ },
1421
+ "typedDictBadVar": {
1422
+ "message": "TypedDict classes can contain only type annotations",
1423
+ "comment": "{Locked='TypedDict'}"
1424
+ },
1425
+ "typedDictBaseClass": {
1426
+ "message": "All base classes for TypedDict classes must also be TypedDict classes",
1427
+ "comment": "{Locked='TypedDict'}"
1428
+ },
1429
+ "typedDictBoolParam": {
1430
+ "message": "Expected \"{name}\" parameter to have a value of True or False",
1431
+ "comment": "{Locked='True','False'}"
1432
+ },
1433
+ "typedDictClosedExtras": {
1434
+ "message": "Base class \"{name}\" is a closed TypedDict; extra items must be type \"{type}\"",
1435
+ "comment": "{Locked='closed','TypedDict'}"
1436
+ },
1437
+ "typedDictClosedNoExtras": {
1438
+ "message": "Base class \"{name}\" is a closed TypedDict; extra items are not allowed",
1439
+ "comment": "{Locked='closed','TypedDict'}"
1440
+ },
1441
+ "typedDictDelete": {
1442
+ "message": "Could not delete item in TypedDict",
1443
+ "comment": "{Locked='TypedDict'}"
1444
+ },
1445
+ "typedDictEmptyName": {
1446
+ "message": "Names within a TypedDict cannot be empty",
1447
+ "comment": "{Locked='TypedDict'}"
1448
+ },
573
1449
  "typedDictEntryName": "Expected string literal for dictionary entry name",
574
1450
  "typedDictEntryUnique": "Names within a dictionary must be unique",
575
- "typedDictExtraArgs": "Extra TypedDict arguments not supported",
576
- "typedDictFieldNotRequiredRedefinition": "TypedDict item \"{name}\" cannot be redefined as NotRequired",
577
- "typedDictFieldReadOnlyRedefinition": "TypedDict item \"{name}\" cannot be redefined as ReadOnly",
578
- "typedDictFieldRequiredRedefinition": "TypedDict item \"{name}\" cannot be redefined as Required",
579
- "typedDictFirstArg": "Expected TypedDict class name as first argument",
580
- "typedDictInitsubclassParameter": "TypedDict does not support __init_subclass__ parameter \"{name}\"",
581
- "typedDictNotAllowed": "\"TypedDict\" cannot be used in this context",
582
- "typedDictSecondArgDict": "Expected dict or keyword parameter as second parameter",
1451
+ "typedDictExtraArgs": {
1452
+ "message": "Extra TypedDict arguments not supported",
1453
+ "comment": "{Locked='TypedDict'}"
1454
+ },
1455
+ "typedDictFieldNotRequiredRedefinition": {
1456
+ "message": "TypedDict item \"{name}\" cannot be redefined as NotRequired",
1457
+ "comment": "{Locked='TypedDict','NotRequired'}"
1458
+ },
1459
+ "typedDictFieldReadOnlyRedefinition": {
1460
+ "message": "TypedDict item \"{name}\" cannot be redefined as ReadOnly",
1461
+ "comment": "{Locked='TypedDict','ReadOnly'}"
1462
+ },
1463
+ "typedDictFieldRequiredRedefinition": {
1464
+ "message": "TypedDict item \"{name}\" cannot be redefined as Required",
1465
+ "comment": "{Locked='TypedDict','Required'}"
1466
+ },
1467
+ "typedDictFirstArg": {
1468
+ "message": "Expected TypedDict class name as first argument",
1469
+ "comment": "{Locked='TypedDict'}"
1470
+ },
1471
+ "typedDictInitsubclassParameter": {
1472
+ "message": "TypedDict does not support __init_subclass__ parameter \"{name}\"",
1473
+ "comment": "{Locked='TypedDict','__init_subclass__'}"
1474
+ },
1475
+ "typedDictNotAllowed": {
1476
+ "message": "\"TypedDict\" cannot be used in this context",
1477
+ "comment": "{Locked='TypedDict'}"
1478
+ },
1479
+ "typedDictSecondArgDict": {
1480
+ "message": "Expected dict or keyword parameter as second parameter",
1481
+ "comment": "{Locked='dict'}"
1482
+ },
583
1483
  "typedDictSecondArgDictEntry": "Expected simple dictionary entry",
584
- "typedDictSet": "Could not assign item in TypedDict",
1484
+ "typedDictSet": {
1485
+ "message": "Could not assign item in TypedDict",
1486
+ "comment": "{Locked='TypedDict'}"
1487
+ },
585
1488
  "unaccessedClass": "Class \"{name}\" is not accessed",
586
1489
  "unaccessedFunction": "Function \"{name}\" is not accessed",
587
1490
  "unaccessedImport": "Import \"{name}\" is not accessed",
@@ -589,105 +1492,290 @@
589
1492
  "unaccessedVariable": "Variable \"{name}\" is not accessed",
590
1493
  "unannotatedFunctionSkipped": "Analysis of function \"{name}\" is skipped because it is unannotated",
591
1494
  "unaryOperationNotAllowed": "Unary operator not allowed in type expression",
592
- "unexpectedAsyncToken": "Expected \"def\", \"with\" or \"for\" to follow \"async\"",
1495
+ "unexpectedAsyncToken": {
1496
+ "message": "Expected \"def\", \"with\" or \"for\" to follow \"async\"",
1497
+ "comment": "{Locked='def','with','for','async'}"
1498
+ },
593
1499
  "unexpectedExprToken": "Unexpected token at end of expression",
594
1500
  "unexpectedIndent": "Unexpected indentation",
595
1501
  "unexpectedUnindent": "Unindent not expected",
596
1502
  "unhashableDictKey": "Dictionary key must be hashable",
597
- "unhashableSetEntry": "Set entry must be hashable",
598
- "uninitializedAbstractVariables": "Variables defined in abstract base class are not initialized in final class \"{classType}\"",
599
- "uninitializedInstanceVariable": "Instance variable \"{name}\" is not initialized in the class body or __init__ method",
600
- "unionForwardReferenceNotAllowed": "Union syntax cannot be used with string operand; use quotes around entire expression",
601
- "unionSyntaxIllegal": "Alternative syntax for unions requires Python 3.10 or newer",
602
- "unionTypeArgCount": "Union requires two or more type arguments",
603
- "unionUnpackedTuple": "Union cannot include an unpacked tuple",
604
- "unionUnpackedTypeVarTuple": "Union cannot include an unpacked TypeVarTuple",
605
- "unnecessaryCast": "Unnecessary \"cast\" call; type is already \"{type}\"",
606
- "unnecessaryIsInstanceAlways": "Unnecessary isinstance call; \"{testType}\" is always an instance of \"{classType}\"",
607
- "unnecessaryIsSubclassAlways": "Unnecessary issubclass call; \"{testType}\" is always a subclass of \"{classType}\"",
608
- "unnecessaryPyrightIgnore": "Unnecessary \"# pyright: ignore\" comment",
609
- "unnecessaryPyrightIgnoreRule": "Unnecessary \"# pyright: ignore\" rule: \"{name}\"",
610
- "unnecessaryTypeIgnore": "Unnecessary \"# type: ignore\" comment",
611
- "unpackArgCount": "Expected a single type argument after \"Unpack\"",
612
- "unpackExpectedTypeVarTuple": "Expected TypeVarTuple or tuple as type argument for Unpack",
613
- "unpackExpectedTypedDict": "Expected TypedDict type argument for Unpack",
614
- "unpackIllegalInComprehension": "Unpack operation not allowed in comprehension",
1503
+ "unhashableSetEntry": {
1504
+ "message": "Set entry must be hashable",
1505
+ "comment": ["{StrContains=i'set'}", "'set' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1506
+ },
1507
+ "uninitializedAbstractVariables": {
1508
+ "message": "Variables defined in abstract base class are not initialized in final class \"{classType}\"",
1509
+ "comment": "{Locked='final'}"
1510
+ },
1511
+ "uninitializedInstanceVariable": {
1512
+ "message": "Instance variable \"{name}\" is not initialized in the class body or __init__ method",
1513
+ "comment": "{Locked='__init__'}"
1514
+ },
1515
+ "unionForwardReferenceNotAllowed": {
1516
+ "message": "Union syntax cannot be used with string operand; use quotes around entire expression",
1517
+ "comment": "{Locked='Union'}"
1518
+ },
1519
+ "unionSyntaxIllegal": {
1520
+ "message": "Alternative syntax for unions requires Python 3.10 or newer",
1521
+ "comment": "'unions' as in the mathematical set theory term"
1522
+ },
1523
+ "unionTypeArgCount": {
1524
+ "message": "Union requires two or more type arguments",
1525
+ "comment": "{Locked='Union'}"
1526
+ },
1527
+ "unionUnpackedTuple": {
1528
+ "message": "Union cannot include an unpacked tuple",
1529
+ "comment": "{Locked='Union','tuple'}"
1530
+ },
1531
+ "unionUnpackedTypeVarTuple": {
1532
+ "message": "Union cannot include an unpacked TypeVarTuple",
1533
+ "comment": "{Locked='Union','TypeVarTuple'}"
1534
+ },
1535
+ "unnecessaryCast": {
1536
+ "message": "Unnecessary \"cast\" call; type is already \"{type}\"",
1537
+ "comment": "{Locked='cast'}"
1538
+ },
1539
+ "unnecessaryIsInstanceAlways": {
1540
+ "message": "Unnecessary isinstance call; \"{testType}\" is always an instance of \"{classType}\"",
1541
+ "comment": "{Locked='isinstance'}"
1542
+ },
1543
+ "unnecessaryIsSubclassAlways": {
1544
+ "message": "Unnecessary issubclass call; \"{testType}\" is always a subclass of \"{classType}\"",
1545
+ "comment": "{Locked='issubclass'}"
1546
+ },
1547
+ "unnecessaryIsInstanceNever": {
1548
+ "message": "Unnecessary isinstance call; \"{testType}\" is never an instance of \"{classType}\"",
1549
+ "comment": "{Locked='isinstance'}"
1550
+ },
1551
+ "unnecessaryIsSubclassNever": {
1552
+ "message": "Unnecessary issubclass call; \"{testType}\" is never a subclass of \"{classType}\"",
1553
+ "comment": "{Locked='issubclass'}"
1554
+ },
1555
+ "unnecessaryPyrightIgnore": {
1556
+ "message": "Unnecessary \"# pyright: ignore\" comment",
1557
+ "comment": "{Locked='# pyright: ignore'}"
1558
+ },
1559
+ "unnecessaryPyrightIgnoreRule": {
1560
+ "message": "Unnecessary \"# pyright: ignore\" rule: \"{name}\"",
1561
+ "comment": "{Locked='# pyright: ignore'}"
1562
+ },
1563
+ "unnecessaryTypeIgnore": {
1564
+ "message": "Unnecessary \"# type: ignore\" comment",
1565
+ "comment": "{Locked='# type: ignore'}"
1566
+ },
1567
+ "unpackArgCount": {
1568
+ "message": "Expected a single type argument after \"Unpack\"",
1569
+ "comment": "{Locked='Unpack'}"
1570
+ },
1571
+ "unpackExpectedTypeVarTuple": {
1572
+ "message": "Expected TypeVarTuple or tuple as type argument for Unpack",
1573
+ "comment": "{Locked='TypeVarTuple','tuple','Unpack'}"
1574
+ },
1575
+ "unpackExpectedTypedDict": {
1576
+ "message": "Expected TypedDict type argument for Unpack",
1577
+ "comment": "{Locked='TypedDict','Unpack'}"
1578
+ },
1579
+ "unpackIllegalInComprehension": {
1580
+ "message": "Unpack operation not allowed in comprehension",
1581
+ "comment": "A comprehension is a 'set of looping and filtering instructions' applied to a collection to generate a new collection; the word may not be translatable"
1582
+ },
615
1583
  "unpackInAnnotation": "Unpack operator not allowed in type expression",
616
1584
  "unpackInDict": "Unpack operation not allowed in dictionaries",
617
- "unpackInSet": "Unpack operator not allowed within a set",
618
- "unpackNotAllowed": "Unpack is not allowed in this context",
1585
+ "unpackInSet": {
1586
+ "message": "Unpack operator not allowed within a set",
1587
+ "comment": "{Locked='set'}"
1588
+ },
1589
+ "unpackNotAllowed": {
1590
+ "message": "Unpack is not allowed in this context",
1591
+ "comment": "{Locked='Unpack'}"
1592
+ },
619
1593
  "unpackOperatorNotAllowed": "Unpack operation is not allowed in this context",
620
- "unpackTuplesIllegal": "Unpack operation not allowed in tuples prior to Python 3.8",
1594
+ "unpackTuplesIllegal": {
1595
+ "message": "Unpack operation not allowed in tuples prior to Python 3.8",
1596
+ "comment": "'tuple' is a keyword and should not be localized, but here it is pluralized"
1597
+ },
621
1598
  "unpackedArgInTypeArgument": "Unpacked arguments cannot be used in this context",
622
- "unpackedArgWithVariadicParam": "Unpacked argument cannot be used for TypeVarTuple parameter",
623
- "unpackedDictArgumentNotMapping": "Argument expression after ** must be a mapping with a \"str\" key type",
1599
+ "unpackedArgWithVariadicParam": {
1600
+ "message": "Unpacked argument cannot be used for TypeVarTuple parameter",
1601
+ "comment": "{Locked='TypeVarTuple'}"
1602
+ },
1603
+ "unpackedDictArgumentNotMapping": {
1604
+ "message": "Argument expression after ** must be a mapping with a \"str\" key type",
1605
+ "comment": "{Locked='str'}"
1606
+ },
624
1607
  "unpackedDictSubscriptIllegal": "Dictionary unpack operator in subscript is not allowed",
625
1608
  "unpackedSubscriptIllegal": "Unpack operator in subscript requires Python 3.11 or newer",
626
- "unpackedTypeVarTupleExpected": "Expected unpacked TypeVarTuple; use Unpack[{name1}] or *{name2}",
627
- "unpackedTypedDictArgument": "Unable to match unpacked TypedDict argument to parameters",
1609
+ "unpackedTypeVarTupleExpected": {
1610
+ "message": "Expected unpacked TypeVarTuple; use Unpack[{name1}] or *{name2}",
1611
+ "comment": "{Locked='TypeVarTuple','Unpack[{name1}]','*{name2}'}"
1612
+ },
1613
+ "unpackedTypedDictArgument": {
1614
+ "message": "Unable to match unpacked TypedDict argument to parameters",
1615
+ "comment": "{Locked='TypedDict'}"
1616
+ },
628
1617
  "unreachableCode": "Code is unreachable",
629
1618
  "unreachableCodeType": "Type analysis indicates code is unreachable",
630
- "unreachableExcept": "Except clause is unreachable because exception is already handled",
631
- "unsupportedDunderAllOperation": "Operation on \"__all__\" is not supported, so exported symbol list may be incorrect",
1619
+ "unreachableExcept": {
1620
+ "message": "Except clause is unreachable because exception is already handled",
1621
+ "comment": ["{StrContains=i'except'}", "'except' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1622
+ },
1623
+ "unsupportedDunderAllOperation": {
1624
+ "message": "Operation on \"__all__\" is not supported, so exported symbol list may be incorrect",
1625
+ "comment": "{Locked='__all__'}"
1626
+ },
632
1627
  "unusedCallResult": "Result of call expression is of type \"{type}\" and is not used; assign to variable \"_\" if this is intentional",
633
- "unusedCoroutine": "Result of async function call is not used; use \"await\" or assign result to variable",
1628
+ "unusedCoroutine": {
1629
+ "message": "Result of async function call is not used; use \"await\" or assign result to variable",
1630
+ "comment": "{Locked='async'}"
1631
+ },
634
1632
  "unusedExpression": "Expression value is unused",
635
- "varAnnotationIllegal": "Type annotations for variables requires Python 3.6 or newer; use type comment for compatibility with previous versions",
636
- "variableFinalOverride": "Variable \"{name}\" is marked Final and overrides non-Final variable of same name in class \"{className}\"",
637
- "variadicTypeArgsTooMany": "Type argument list can have at most one unpacked TypeVarTuple or tuple",
638
- "variadicTypeParamTooManyAlias": "Type alias can have at most one TypeVarTuple type parameter but received multiple ({names})",
639
- "variadicTypeParamTooManyClass": "Generic class can have at most one TypeVarTuple type parameter but received multiple ({names})",
1633
+ "varAnnotationIllegal": {
1634
+ "message": "Type annotations for variables requires Python 3.6 or newer; use type comment for compatibility with previous versions",
1635
+ "comment": "{Locked='type'}"
1636
+ },
1637
+ "variableFinalOverride": {
1638
+ "message": "Variable \"{name}\" is marked Final and overrides non-Final variable of same name in class \"{className}\"",
1639
+ "comment": "{Locked='Final'}"
1640
+ },
1641
+ "variadicTypeArgsTooMany": {
1642
+ "message": "Type argument list can have at most one unpacked TypeVarTuple or tuple",
1643
+ "comment": "{Locked='TypeVarTuple','tuple'}"
1644
+ },
1645
+ "variadicTypeParamTooManyAlias": {
1646
+ "message": "Type alias can have at most one TypeVarTuple type parameter but received multiple ({names})",
1647
+ "comment": "{Locked='TypeVarTuple'}"
1648
+ },
1649
+ "variadicTypeParamTooManyClass": {
1650
+ "message": "Generic class can have at most one TypeVarTuple type parameter but received multiple ({names})",
1651
+ "comment": ["{Locked='TypeVarTuple'}", "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"]
1652
+ },
640
1653
  "walrusIllegal": "Operator \":=\" requires Python 3.8 or newer",
641
1654
  "walrusNotAllowed": "Operator \":=\" is not allowed in this context without surrounding parentheses",
642
- "wildcardInFunction": "Wildcard import not allowed within a class or function",
643
- "wildcardLibraryImport": "Wildcard import from a library not allowed",
1655
+ "wildcardInFunction": {
1656
+ "message": "Wildcard import not allowed within a class or function",
1657
+ "comment": "{Locked='import'}"
1658
+ },
1659
+ "wildcardLibraryImport": {
1660
+ "message": "Wildcard import from a library not allowed",
1661
+ "comment": "{Locked='import'}"
1662
+ },
644
1663
  "wildcardPatternTypePartiallyUnknown": "Type captured by wildcard pattern is partially unknown",
645
1664
  "wildcardPatternTypeUnknown": "Type captured by wildcard pattern is unknown",
646
- "yieldFromIllegal": "Use of \"yield from\" requires Python 3.3 or newer",
647
- "yieldFromOutsideAsync": "\"yield from\" not allowed in an async function",
648
- "yieldOutsideFunction": "\"yield\" not allowed outside of a function or lambda",
649
- "yieldWithinComprehension": "\"yield\" not allowed inside a comprehension",
650
- "zeroCaseStatementsFound": "Match statement must include at least one case statement",
651
- "zeroLengthTupleNotAllowed": "Zero-length tuple is not allowed in this context"
1665
+ "yieldFromIllegal": {
1666
+ "message": "Use of \"yield from\" requires Python 3.3 or newer",
1667
+ "comment": "{Locked='yield from'}"
1668
+ },
1669
+ "yieldFromOutsideAsync": {
1670
+ "message": "\"yield from\" not allowed in an async function",
1671
+ "comment": "{Locked='yield from','async'}"
1672
+ },
1673
+ "yieldOutsideFunction": {
1674
+ "message": "\"yield\" not allowed outside of a function or lambda",
1675
+ "comment": "{Locked='yield'}"
1676
+ },
1677
+ "yieldWithinComprehension": {
1678
+ "message": "\"yield\" not allowed inside a comprehension",
1679
+ "comment": ["{Locked='yield'}", "A comprehension is a 'set of looping and filtering instructions' applied to a collection to generate a new collection; the word may not be translatable"]
1680
+ },
1681
+ "zeroCaseStatementsFound": {
1682
+ "message": "Match statement must include at least one case statement",
1683
+ "comment": ["{Locked='case'}", "{StrContains=i'match'}", "'match' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1684
+ },
1685
+ "zeroLengthTupleNotAllowed": {
1686
+ "message": "Zero-length tuple is not allowed in this context",
1687
+ "comment": "{Locked='tuple'}"
1688
+ }
652
1689
  },
653
1690
  "DiagnosticAddendum": {
654
- "annotatedNotAllowed": "\"Annotated\" special form cannot be used with instance and class checks",
1691
+ "annotatedNotAllowed": {
1692
+ "message": "\"Annotated\" special form cannot be used with instance and class checks",
1693
+ "comment": "{Locked='Annotated'}"
1694
+ },
655
1695
  "argParam": "Argument corresponds to parameter \"{paramName}\"",
656
1696
  "argParamFunction": "Argument corresponds to parameter \"{paramName}\" in function \"{functionName}\"",
657
1697
  "argsParamMissing": "Parameter \"*{paramName}\" has no corresponding parameter",
658
1698
  "argsPositionOnly": "Position-only parameter mismatch; expected {expected} but received {received}",
659
1699
  "argumentType": "Argument type is \"{type}\"",
660
1700
  "argumentTypes": "Argument types: ({types})",
661
- "assignToNone": "Type is not assignable to \"None\"",
662
- "asyncHelp": "Did you mean \"async with\"?",
1701
+ "assignToNone": {
1702
+ "message": "Type is not assignable to \"None\"",
1703
+ "comment": "{Locked='None'}"
1704
+ },
1705
+ "asyncHelp": {
1706
+ "message": "Did you mean \"async with\"?",
1707
+ "comment": "{Locked='async with'}"
1708
+ },
663
1709
  "baseClassIncompatible": "Base class \"{baseClass}\" is incompatible with type \"{type}\"",
664
1710
  "baseClassIncompatibleSubclass": "Base class \"{baseClass}\" derives from \"{subclass}\" which is incompatible with type \"{type}\"",
665
1711
  "baseClassOverriddenType": "Base class \"{baseClass}\" provides type \"{type}\", which is overridden",
666
1712
  "baseClassOverridesType": "Base class \"{baseClass}\" overrides with type \"{type}\"",
667
- "bytesTypePromotions": "Set disableBytesTypePromotions to false to enable type promotion behavior for \"bytearray\" and \"memoryview\"",
668
- "conditionalRequiresBool": "Method __bool__ for type \"{operandType}\" returns type \"{boolReturnType}\" rather than \"bool\"",
1713
+ "bytesTypePromotions": {
1714
+ "message": "Set disableBytesTypePromotions to false to enable type promotion behavior for \"bytearray\" and \"memoryview\"",
1715
+ "comment": "{Locked='disableBytesTypePromotions','false','bytearray','memoryview'}"
1716
+ },
1717
+ "conditionalRequiresBool": {
1718
+ "message": "Method __bool__ for type \"{operandType}\" returns type \"{boolReturnType}\" rather than \"bool\"",
1719
+ "comment": "{Locked='__bool__'}"
1720
+ },
669
1721
  "dataClassFieldLocation": "Field declaration",
670
1722
  "dataClassFrozen": "\"{name}\" is frozen",
671
1723
  "dataProtocolUnsupported": "\"{name}\" is a data protocol",
672
- "descriptorAccessBindingFailed": "Failed to bind method \"{name}\" for descriptor class \"{className}\"",
1724
+ "descriptorAccessBindingFailed": {
1725
+ "message": "Failed to bind method \"{name}\" for descriptor class \"{className}\"",
1726
+ "comment": "Binding is the process through which Pyright determines what object a name refers to"
1727
+ },
673
1728
  "descriptorAccessCallFailed": "Failed to call method \"{name}\" for descriptor class \"{className}\"",
674
- "finalMethod": "Final method",
1729
+ "finalMethod": {
1730
+ "message": "Final method",
1731
+ "comment": "{Locked='Final'}"
1732
+ },
675
1733
  "functionParamDefaultMissing": "Parameter \"{name}\" is missing default argument",
676
1734
  "functionParamName": "Parameter name mismatch: \"{destName}\" versus \"{srcName}\"",
677
1735
  "functionParamPositionOnly": "Position-only parameter mismatch; parameter \"{name}\" is not position-only",
678
1736
  "functionReturnTypeMismatch": "Function return type \"{sourceType}\" is incompatible with type \"{destType}\"",
679
1737
  "functionTooFewParams": "Function accepts too few positional parameters; expected {expected} but received {received}",
680
1738
  "functionTooManyParams": "Function accepts too many positional parameters; expected {expected} but received {received}",
681
- "genericClassNotAllowed": "Generic type with type arguments not allowed for instance or class checks",
682
- "incompatibleDeleter": "Property deleter method is incompatible",
683
- "incompatibleGetter": "Property getter method is incompatible",
684
- "incompatibleSetter": "Property setter method is incompatible",
685
- "initMethodLocation": "The __init__ method is defined in class \"{type}\"",
686
- "initMethodSignature": "Signature of __init__ is \"{type}\"",
687
- "initSubclassLocation": "The __init_subclass__ method is defined in class \"{name}\"",
688
- "invariantSuggestionDict": "Consider switching from \"dict\" to \"Mapping\" which is covariant in the value type",
689
- "invariantSuggestionList": "Consider switching from \"list\" to \"Sequence\" which is covariant",
690
- "invariantSuggestionSet": "Consider switching from \"set\" to \"Container\" which is covariant",
1739
+ "genericClassNotAllowed": {
1740
+ "message": "Generic type with type arguments not allowed for instance or class checks",
1741
+ "comment": "A generic type is a parameterized type, for example a container where the generic type parameter specifies the type of elements in the container"
1742
+ },
1743
+ "incompatibleDeleter": {
1744
+ "message": "Property deleter method is incompatible",
1745
+ "comment": ["{Locked='deleter'}", "{StrContains=i'property'}", "'property' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1746
+ },
1747
+ "incompatibleGetter": {
1748
+ "message": "Property getter method is incompatible",
1749
+ "comment": ["{Locked='getter'}", "{StrContains=i'property'}", "'property' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1750
+ },
1751
+ "incompatibleSetter": {
1752
+ "message": "Property setter method is incompatible",
1753
+ "comment": ["{Locked='setter'}", "{StrContains=i'property'}", "'property' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1754
+ },
1755
+ "initMethodLocation": {
1756
+ "message": "The __init__ method is defined in class \"{type}\"",
1757
+ "comment": "{Locked='__init__'}"
1758
+ },
1759
+ "initMethodSignature": {
1760
+ "message": "Signature of __init__ is \"{type}\"",
1761
+ "comment": "{Locked='__init__'}"
1762
+ },
1763
+ "initSubclassLocation": {
1764
+ "message": "The __init_subclass__ method is defined in class \"{name}\"",
1765
+ "comment": "{Locked='__init_subclass__'}"
1766
+ },
1767
+ "invariantSuggestionDict": {
1768
+ "message": "Consider switching from \"dict\" to \"Mapping\" which is covariant in the value type",
1769
+ "comment": "{Locked='dict','Mapping'}"
1770
+ },
1771
+ "invariantSuggestionList": {
1772
+ "message": "Consider switching from \"list\" to \"Sequence\" which is covariant",
1773
+ "comment": "{Locked='list','Sequence'}"
1774
+ },
1775
+ "invariantSuggestionSet": {
1776
+ "message": "Consider switching from \"set\" to \"Container\" which is covariant",
1777
+ "comment": "{Locked='set','Container'}"
1778
+ },
691
1779
  "isinstanceClassNotSupported": "\"{type}\" is not supported for instance and class checks",
692
1780
  "keyNotRequired": "\"{name}\" is not a required key in \"{type}\", so access may result in runtime exception",
693
1781
  "keyReadOnly": "\"{name}\" is a read-only key in \"{type}\"",
@@ -696,35 +1784,83 @@
696
1784
  "kwargsParamMissing": "Parameter \"**{paramName}\" has no corresponding parameter",
697
1785
  "listAssignmentMismatch": "Type \"{type}\" is incompatible with target list",
698
1786
  "literalAssignmentMismatch": "\"{sourceType}\" is not assignable to type \"{destType}\"",
699
- "matchIsNotExhaustiveHint": "If exhaustive handling is not intended, add \"case _: pass\"",
1787
+ "matchIsNotExhaustiveHint": {
1788
+ "message": "If exhaustive handling is not intended, add \"case _: pass\"",
1789
+ "comment": "{Locked='case _: pass'}"
1790
+ },
700
1791
  "matchIsNotExhaustiveType": "Unhandled type: \"{type}\"",
701
1792
  "memberAssignment": "Expression of type \"{type}\" cannot be assigned to attribute \"{name}\" of class \"{classType}\"",
702
1793
  "memberIsAbstract": "\"{type}.{name}\" is not implemented",
703
- "memberIsAbstractMore": "and {count} more...",
704
- "memberIsClassVarInProtocol": "\"{name}\" is defined as a ClassVar in protocol",
705
- "memberIsInitVar": "\"{name}\" is an init-only field",
1794
+ "memberIsAbstractMore": {
1795
+ "message": "and {count} more...",
1796
+ "comment": "{StrEnds='...'}"
1797
+ },
1798
+ "memberIsClassVarInProtocol": {
1799
+ "message": "\"{name}\" is defined as a ClassVar in protocol",
1800
+ "comment": "{Locked='ClassVar'}"
1801
+ },
1802
+ "memberIsInitVar": {
1803
+ "message": "\"{name}\" is an init-only field",
1804
+ "comment": "{Locked='init-only'}"
1805
+ },
706
1806
  "memberIsInvariant": "\"{name}\" is invariant because it is mutable",
707
- "memberIsNotClassVarInClass": "\"{name}\" must be defined as a ClassVar to be compatible with protocol",
708
- "memberIsNotClassVarInProtocol": "\"{name}\" is not defined as a ClassVar in protocol",
1807
+ "memberIsNotClassVarInClass": {
1808
+ "message": "\"{name}\" must be defined as a ClassVar to be compatible with protocol",
1809
+ "comment": "{Locked='ClassVar'}"
1810
+ },
1811
+ "memberIsNotClassVarInProtocol": {
1812
+ "message": "\"{name}\" is not defined as a ClassVar in protocol",
1813
+ "comment": "{Locked='ClassVar'}"
1814
+ },
709
1815
  "memberIsNotReadOnlyInProtocol": "\"{name}\" is not read-only in protocol",
710
1816
  "memberIsReadOnlyInProtocol": "\"{name}\" is read-only in protocol",
711
1817
  "memberIsWritableInProtocol": "\"{name}\" is writable in protocol",
712
- "memberSetClassVar": "Attribute \"{name}\" cannot be assigned through a class instance because it is a ClassVar",
1818
+ "memberSetClassVar": {
1819
+ "message": "Attribute \"{name}\" cannot be assigned through a class instance because it is a ClassVar",
1820
+ "comment": "{Locked='ClassVar'}"
1821
+ },
713
1822
  "memberTypeMismatch": "\"{name}\" is an incompatible type",
714
1823
  "memberUnknown": "Attribute \"{name}\" is unknown",
715
- "metaclassConflict": "Metaclass \"{metaclass1}\" conflicts with \"{metaclass2}\"",
716
- "missingDeleter": "Property deleter method is missing",
717
- "missingGetter": "Property getter method is missing",
718
- "missingSetter": "Property setter method is missing",
1824
+ "metaclassConflict": {
1825
+ "message": "Metaclass \"{metaclass1}\" conflicts with \"{metaclass2}\"",
1826
+ "comment": "Metaclasses are a complex concept and it may be best to not localize the term"
1827
+ },
1828
+ "missingDeleter": {
1829
+ "message": "Property deleter method is missing",
1830
+ "comment": ["{Locked='deleter'}", "{StrContains=i'property'}", "'property' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1831
+ },
1832
+ "missingGetter": {
1833
+ "message": "Property getter method is missing",
1834
+ "comment": ["{Locked='getter'}", "{StrContains=i'property'}", "'property' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1835
+ },
1836
+ "missingSetter": {
1837
+ "message": "Property setter method is missing",
1838
+ "comment": ["{Locked='setter'}", "{StrContains=i'property'}", "'property' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1839
+ },
719
1840
  "namedParamMissingInDest": "Extra parameter \"{name}\"",
720
1841
  "namedParamMissingInSource": "Missing keyword parameter \"{name}\"",
721
1842
  "namedParamTypeMismatch": "Keyword parameter \"{name}\" of type \"{sourceType}\" is incompatible with type \"{destType}\"",
722
- "namedTupleNotAllowed": "NamedTuple cannot be used for instance or class checks",
723
- "newMethodLocation": "The __new__ method is defined in class \"{type}\"",
724
- "newMethodSignature": "Signature of __new__ is \"{type}\"",
725
- "newTypeClassNotAllowed": "Class created with NewType cannot be used with instance and class checks",
1843
+ "namedTupleNotAllowed": {
1844
+ "message": "NamedTuple cannot be used for instance or class checks",
1845
+ "comment": "{Locked='NamedTuple'}"
1846
+ },
1847
+ "newMethodLocation": {
1848
+ "message": "The __new__ method is defined in class \"{type}\"",
1849
+ "comment": "{Locked='__new__'}"
1850
+ },
1851
+ "newMethodSignature": {
1852
+ "message": "Signature of __new__ is \"{type}\"",
1853
+ "comment": "{Locked='__new__'}"
1854
+ },
1855
+ "newTypeClassNotAllowed": {
1856
+ "message": "Class created with NewType cannot be used with instance and class checks",
1857
+ "comment": "{Locked='NewType'}"
1858
+ },
726
1859
  "noOverloadAssignable": "No overloaded function matches type \"{type}\"",
727
- "noneNotAllowed": "None cannot be used for instance or class checks",
1860
+ "noneNotAllowed": {
1861
+ "message": "None cannot be used for instance or class checks",
1862
+ "comment": "{Locked='None'}"
1863
+ },
728
1864
  "orPatternMissingName": "Missing names: {name}",
729
1865
  "overloadIndex": "Overload {index} is the closest match",
730
1866
  "overloadNotAssignable": "One or more overloads of \"{name}\" is not assignable",
@@ -734,9 +1870,15 @@
734
1870
  "overrideInvariantMismatch": "Override type \"{overrideType}\" is not the same as base type \"{baseType}\"",
735
1871
  "overrideIsInvariant": "Variable is mutable so its type is invariant",
736
1872
  "overrideNoOverloadMatches": "No overload signature in override is compatible with base method",
737
- "overrideNotClassMethod": "Base method is declared as a classmethod but override is not",
1873
+ "overrideNotClassMethod": {
1874
+ "message": "Base method is declared as a classmethod but override is not",
1875
+ "comment": "{Locked='classmethod'}"
1876
+ },
738
1877
  "overrideNotInstanceMethod": "Base method is declared as an instance method but override is not",
739
- "overrideNotStaticMethod": "Base method is declared as a staticmethod but override is not",
1878
+ "overrideNotStaticMethod": {
1879
+ "message": "Base method is declared as a staticmethod but override is not",
1880
+ "comment": "{Locked='staticmethod'}"
1881
+ },
740
1882
  "overrideOverloadNoMatch": "Override does not handle all overloads of base method",
741
1883
  "overrideOverloadOrder": "Overloads for override method must be in the same order as the base method",
742
1884
  "overrideParamKeywordNoDefault": "Keyword parameter \"{name}\" mismatch: base parameter has default argument value, override parameter does not",
@@ -751,20 +1893,41 @@
751
1893
  "overrideReturnType": "Return type mismatch: base method returns type \"{baseType}\", override returns type \"{overrideType}\"",
752
1894
  "overrideType": "Base class defines type as \"{type}\"",
753
1895
  "paramAssignment": "Parameter {index}: type \"{sourceType}\" is incompatible with type \"{destType}\"",
754
- "paramSpecMissingInOverride": "ParamSpec parameters are missing in override method",
1896
+ "paramSpecMissingInOverride": {
1897
+ "message": "ParamSpec parameters are missing in override method",
1898
+ "comment": "{Locked='ParamSpec'}"
1899
+ },
755
1900
  "paramType": "Parameter type is \"{paramType}\"",
756
1901
  "privateImportFromPyTypedSource": "Import from \"{module}\" instead",
757
1902
  "propertyAccessFromProtocolClass": "A property defined within a protocol class cannot be accessed as a class variable",
758
- "propertyMethodIncompatible": "Property method \"{name}\" is incompatible",
759
- "propertyMethodMissing": "Property method \"{name}\" is missing in override",
760
- "propertyMissingDeleter": "Property \"{name}\" has no defined deleter",
761
- "propertyMissingSetter": "Property \"{name}\" has no defined setter",
1903
+ "propertyMethodIncompatible": {
1904
+ "message": "Property method \"{name}\" is incompatible",
1905
+ "comment": ["{StrContains=i'property'}", "'property' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1906
+ },
1907
+ "propertyMethodMissing": {
1908
+ "message": "Property method \"{name}\" is missing in override",
1909
+ "comment": ["{StrContains=i'property'}", "'property' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1910
+ },
1911
+ "propertyMissingDeleter": {
1912
+ "message": "Property \"{name}\" has no defined deleter",
1913
+ "comment": ["{Locked='deleter'}", "{StrContains=i'property'}", "'property' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1914
+ },
1915
+ "propertyMissingSetter": {
1916
+ "message": "Property \"{name}\" has no defined setter",
1917
+ "comment": ["{Locked='setter'}", "{StrContains=i'property'}", "'property' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1918
+ },
762
1919
  "protocolIncompatible": "\"{sourceType}\" is incompatible with protocol \"{destType}\"",
763
1920
  "protocolMemberMissing": "\"{name}\" is not present",
764
- "protocolRequiresRuntimeCheckable": "Protocol class must be @runtime_checkable to be used with instance and class checks",
1921
+ "protocolRequiresRuntimeCheckable": {
1922
+ "message": "Protocol class must be @runtime_checkable to be used with instance and class checks",
1923
+ "comment": "{Locked='Protocol','@runtime_checkable'}"
1924
+ },
765
1925
  "protocolSourceIsNotConcrete": "\"{sourceType}\" is not a concrete class type and cannot be assigned to type \"{destType}\"",
766
1926
  "protocolUnsafeOverlap": "Attributes of \"{name}\" have the same names as the protocol",
767
- "pyrightCommentIgnoreTip": "Use \"# pyright: ignore[<diagnostic rules>] to suppress diagnostics for a single line",
1927
+ "pyrightCommentIgnoreTip": {
1928
+ "message": "Use \"# pyright: ignore[<diagnostic rules>]\" to suppress diagnostics for a single line",
1929
+ "comment": "{Locked='# pyright: ignore[<diagnostic rules>]'}"
1930
+ },
768
1931
  "readOnlyAttribute": "Attribute \"{name}\" is read-only",
769
1932
  "seeClassDeclaration": "See class declaration",
770
1933
  "seeDeclaration": "See declaration",
@@ -773,13 +1936,34 @@
773
1936
  "seeParameterDeclaration": "See parameter declaration",
774
1937
  "seeTypeAliasDeclaration": "See type alias declaration",
775
1938
  "seeVariableDeclaration": "See variable declaration",
776
- "tupleAssignmentMismatch": "Type \"{type}\" is incompatible with target tuple",
777
- "tupleEntryTypeMismatch": "Tuple entry {entry} is incorrect type",
778
- "tupleSizeIndeterminateSrc": "Tuple size mismatch; expected {expected} but received indeterminate",
779
- "tupleSizeIndeterminateSrcDest": "Tuple size mismatch; expected {expected} or more but received indeterminate",
780
- "tupleSizeMismatch": "Tuple size mismatch; expected {expected} but received {received}",
781
- "tupleSizeMismatchIndeterminateDest": "Tuple size mismatch; expected {expected} or more but received {received}",
782
- "typeAliasInstanceCheck": "Type alias created with \"type\" statement cannot be used with instance and class checks",
1939
+ "tupleAssignmentMismatch": {
1940
+ "message": "Type \"{type}\" is incompatible with target tuple",
1941
+ "comment": "{Locked='tuple'}"
1942
+ },
1943
+ "tupleEntryTypeMismatch": {
1944
+ "message": "Tuple entry {entry} is incorrect type",
1945
+ "comment": ["{StrContains=i'tuple'}", "'tuple' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1946
+ },
1947
+ "tupleSizeIndeterminateSrc": {
1948
+ "message": "Tuple size mismatch; expected {expected} but received indeterminate",
1949
+ "comment": ["{StrContains=i'tuple'}", "'tuple' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1950
+ },
1951
+ "tupleSizeIndeterminateSrcDest": {
1952
+ "message": "Tuple size mismatch; expected {expected} or more but received indeterminate",
1953
+ "comment": ["{StrContains=i'tuple'}", "'tuple' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1954
+ },
1955
+ "tupleSizeMismatch": {
1956
+ "message": "Tuple size mismatch; expected {expected} but received {received}",
1957
+ "comment": ["{StrContains=i'tuple'}", "'tuple' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1958
+ },
1959
+ "tupleSizeMismatchIndeterminateDest": {
1960
+ "message": "Tuple size mismatch; expected {expected} or more but received {received}",
1961
+ "comment": ["{StrContains=i'tuple'}", "'tuple' is a keyword and should not be localized. It is only capitalized here because it is the first word in the sentence"]
1962
+ },
1963
+ "typeAliasInstanceCheck": {
1964
+ "message": "Type alias created with \"type\" statement cannot be used with instance and class checks",
1965
+ "comment": "{Locked='type'}"
1966
+ },
783
1967
  "typeAssignmentMismatch": "Type \"{sourceType}\" is not assignable to type \"{destType}\"",
784
1968
  "typeBound": "Type \"{sourceType}\" is not assignable to upper bound \"{destType}\" for type variable \"{name}\"",
785
1969
  "typeConstrainedTypeVar": "Type \"{type}\" is not assignable to constrained type variable \"{name}\"",
@@ -787,40 +1971,82 @@
787
1971
  "typeNotClass": "\"{type}\" is not a class",
788
1972
  "typeNotStringLiteral": "\"{type}\" is not a string literal",
789
1973
  "typeOfSymbol": "Type of \"{name}\" is \"{type}\"",
790
- "typeParamSpec": "Type \"{type}\" is incompatible with ParamSpec \"{name}\"",
1974
+ "typeParamSpec": {
1975
+ "message": "Type \"{type}\" is incompatible with ParamSpec \"{name}\"",
1976
+ "comment": "{Locked='ParamSpec'}"
1977
+ },
791
1978
  "typeUnsupported": "Type \"{type}\" is unsupported",
792
1979
  "typeVarDefaultOutOfScope": "Type variable \"{name}\" is not in scope",
793
1980
  "typeVarIsContravariant": "Type parameter \"{name}\" is contravariant, but \"{sourceType}\" is not a supertype of \"{destType}\"",
794
1981
  "typeVarIsCovariant": "Type parameter \"{name}\" is covariant, but \"{sourceType}\" is not a subtype of \"{destType}\"",
795
1982
  "typeVarIsInvariant": "Type parameter \"{name}\" is invariant, but \"{sourceType}\" is not the same as \"{destType}\"",
796
- "typeVarNotAllowed": "TypeVar not allowed for instance or class checks",
797
- "typeVarTupleRequiresKnownLength": "TypeVarTuple cannot be bound to a tuple of unknown length",
1983
+ "typeVarNotAllowed": {
1984
+ "message": "TypeVar not allowed for instance or class checks",
1985
+ "comment": "{Locked='TypeVar'}"
1986
+ },
1987
+ "typeVarTupleRequiresKnownLength": {
1988
+ "message": "TypeVarTuple cannot be bound to a tuple of unknown length",
1989
+ "comment": "{Locked='TypeVarTuple','tuple'}"
1990
+ },
798
1991
  "typeVarUnnecessarySuggestion": "Use {type} instead",
799
1992
  "typeVarUnsolvableRemedy": "Provide an overload that specifies the return type when the argument is not supplied",
800
1993
  "typeVarsMissing": "Missing type variables: {names}",
801
- "typedDictBaseClass": "Class \"{type}\" is not a TypedDict",
802
- "typedDictClassNotAllowed": "TypedDict class not allowed for instance or class checks",
1994
+ "typedDictBaseClass": {
1995
+ "message": "Class \"{type}\" is not a TypedDict",
1996
+ "comment": "{Locked='TypedDict'}"
1997
+ },
1998
+ "typedDictClassNotAllowed": {
1999
+ "message": "TypedDict class not allowed for instance or class checks",
2000
+ "comment": "{Locked='TypedDict'}"
2001
+ },
803
2002
  "typedDictClosedExtraNotAllowed": "Cannot add item \"{name}\"",
804
2003
  "typedDictClosedExtraTypeMismatch": "Cannot add item \"{name}\" with type \"{type}\"",
805
- "typedDictClosedFieldNotRequired": "Cannot add item \"{name}\" because it must be NotRequired",
2004
+ "typedDictClosedFieldNotRequired": {
2005
+ "message": "Cannot add item \"{name}\" because it must be NotRequired",
2006
+ "comment": "{Locked='NotRequired'}"
2007
+ },
806
2008
  "typedDictExtraFieldNotAllowed": "\"{name}\" is not present in \"{type}\"",
807
- "typedDictExtraFieldTypeMismatch": "Type of \"{name}\" is incompatible with type of \"__extra_items__\" in \"{type}\"",
2009
+ "typedDictExtraFieldTypeMismatch": {
2010
+ "message": "Type of \"{name}\" is incompatible with type of \"__extra_items__\" in \"{type}\"",
2011
+ "comment": "{Locked='__extra_items__'}"
2012
+ },
808
2013
  "typedDictFieldMissing": "\"{name}\" is missing from \"{type}\"",
809
2014
  "typedDictFieldNotReadOnly": "\"{name}\" is not read-only in \"{type}\"",
810
2015
  "typedDictFieldNotRequired": "\"{name}\" is not required in \"{type}\"",
811
2016
  "typedDictFieldRequired": "\"{name}\" is required in \"{type}\"",
812
2017
  "typedDictFieldTypeMismatch": "Type \"{type}\" is not assignable to item \"{name}\"",
813
2018
  "typedDictFieldUndefined": "\"{name}\" is an undefined item in type \"{type}\"",
814
- "typedDictFinalMismatch": "\"{sourceType}\" is incompatible with \"{destType}\" because of a @final mismatch",
815
- "typedDictKeyAccess": "Use [\"{name}\"] to reference item in TypedDict",
816
- "typedDictNotAllowed": "TypedDict cannot be used for instance or class checks",
2019
+ "typedDictFinalMismatch": {
2020
+ "message": "\"{sourceType}\" is incompatible with \"{destType}\" because of a @final mismatch",
2021
+ "comment": "{Locked='@final'}"
2022
+ },
2023
+ "typedDictKeyAccess": {
2024
+ "message": "Use [\"{name}\"] to reference item in TypedDict",
2025
+ "comment": "{Locked='TypedDict'}"
2026
+ },
2027
+ "typedDictNotAllowed": {
2028
+ "message": "TypedDict cannot be used for instance or class checks",
2029
+ "comment": "{Locked='TypedDict'}"
2030
+ },
817
2031
  "unhashableType": "Type \"{type}\" is not hashable",
818
2032
  "uninitializedAbstractVariable": "Instance variable \"{name}\" is defined in abstract base class \"{classType}\" but not initialized",
819
2033
  "unreachableExcept": "\"{exceptionType}\" is a subclass of \"{parentType}\"",
820
- "useDictInstead": "Use Dict[T1, T2] to indicate a dictionary type",
821
- "useListInstead": "Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type",
822
- "useTupleInstead": "Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type",
823
- "useTypeInstead": "Use Type[T] instead",
2034
+ "useDictInstead": {
2035
+ "message": "Use Dict[T1, T2] to indicate a dictionary type",
2036
+ "comment": "{Locked='Dict[T1, T2]'}"
2037
+ },
2038
+ "useListInstead": {
2039
+ "message": "Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type",
2040
+ "comment": "{Locked='List[T]','list','Union[T1, T2]','union'}"
2041
+ },
2042
+ "useTupleInstead": {
2043
+ "message": "Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type",
2044
+ "comment": "{Locked='tuple[T1, ..., Tn]','tuple','Union[T1, T2]','union'}"
2045
+ },
2046
+ "useTypeInstead": {
2047
+ "message": "Use Type[T] instead",
2048
+ "comment": "{Locked='Type[T]'}"
2049
+ },
824
2050
  "varianceMismatchForClass": "Variance of type argument \"{typeVarName}\" is incompatible with base class \"{className}\"",
825
2051
  "varianceMismatchForTypeAlias": "Variance of type argument \"{typeVarName}\" is incompatible with \"{typeAliasParam}\""
826
2052
  },