@@ -122,8 +122,8 @@ assume here is some 3rd party library you've installed and are importing. These
122
122
1. Selectively disallow untyped function definitions only within the ``mycode.foo ``
123
123
package -- that is, only for function definitions defined in the
124
124
``mycode/foo `` directory.
125
-
126
- 2. Selectively *disable * the "function is returning any" warnings within
125
+
126
+ 2. Selectively *disable * the "function is returning any" warnings within
127
127
``mycode.bar `` only. This overrides the global default we set earlier.
128
128
129
129
3. Suppress any error messages generated when your codebase tries importing the
@@ -155,22 +155,22 @@ Note: this section describes options that can be used both globally and per-modu
155
155
See below for a list of import discovery options that may be used
156
156
:ref: `only globally <config-file-import-discovery-global >`.
157
157
158
- ``ignore_missing_imports `` (bool, default False)
158
+ ``ignore_missing_imports `` (bool, default False)
159
159
Suppresses error messages about imports that cannot be resolved.
160
160
161
161
If this option is used in a per-module section, the module name should
162
162
match the name of the *imported * module, not the module containing the
163
163
import statement.
164
164
165
- ``follow_imports `` (string, default ``normal ``)
165
+ ``follow_imports `` (string, default ``normal ``)
166
166
Directs what to do with imports when the imported module is found
167
- as a ``.py `` file and not part of the files, modules and packages
167
+ as a ``.py `` file and not part of the files, modules and packages
168
168
provided on the command line.
169
169
170
170
The four possible values are ``normal ``, ``silent ``, ``skip `` and
171
171
``error ``. For explanations see the discussion for the
172
- :ref: `--follow-imports <follow-imports >` command line flag.
173
-
172
+ :ref: `--follow-imports <follow-imports >` command line flag.
173
+
174
174
If this option is used in a per-module section, the module name should
175
175
match the name of the *imported * module, not the module containing the
176
176
import statement.
@@ -228,7 +228,7 @@ section of the command line docs.
228
228
annotations.
229
229
230
230
``disallow_incomplete_defs `` (bool, default False)
231
- Disallows defining functions with incomplete type annotations.
231
+ Disallows defining functions with incomplete type annotations.
232
232
233
233
``check_untyped_defs `` (bool, default False)
234
234
Type-checks the interior of functions without type annotations.
@@ -265,7 +265,7 @@ section of the command line docs.
265
265
``warn_unused_ignores `` (bool, default False)
266
266
Warns about unneeded ``# type: ignore `` comments.
267
267
268
- ``warn_no_return `` (bool, default True)
268
+ ``warn_no_return `` (bool, default True)
269
269
Shows errors for missing return statements on some execution paths.
270
270
271
271
``warn_return_any `` (bool, default False)
@@ -287,6 +287,12 @@ no analog available via the command line options.
287
287
``ignore_errors `` (bool, default False)
288
288
Ignores all non-fatal errors.
289
289
290
+ Miscellaneous strictness flags
291
+ ------------------------------
292
+
293
+ ``allow_redefinition `` (bool, default false)
294
+ Allows variables to be redefined with an arbitrary type, as long as the redefinition
295
+ is in the same block and nesting level as the original definition.
290
296
291
297
Global-only options
292
298
*******************
@@ -302,7 +308,7 @@ For more information, see the :ref:`import discovery <import-discovery>`
302
308
section of the command line docs.
303
309
304
310
Note: this section describes only global-only import discovery options. See above for
305
- a list of import discovery options that may be used
311
+ a list of import discovery options that may be used
306
312
:ref: `both per-module and globally <config-file-import-discovery-per-module >`.
307
313
308
314
``namespace_packages `` (bool, default False)
@@ -330,7 +336,7 @@ Platform configuration
330
336
For more information, see the :ref: `platform configuration <platform-configuration >`
331
337
section of the command line docs.
332
338
333
- ``python_version `` (string)
339
+ ``python_version `` (string)
334
340
Specifies the Python version used to parse and check the target
335
341
program. The string should be in the format ``DIGIT.DIGIT `` --
336
342
for example ``2.7 ``. The default is the version of the Python
@@ -343,11 +349,11 @@ section of the command line docs.
343
349
``sys.platform `` variable.
344
350
345
351
``always_true `` (comma-separated list of strings)
346
- Specifies a list of variables that mypy will treat as
352
+ Specifies a list of variables that mypy will treat as
347
353
compile-time constants that are always true.
348
-
349
- ``always_false `` (comma-separated list of strings)
350
- Specifies a list of variables that mypy will treat as
354
+
355
+ ``always_false `` (comma-separated list of strings)
356
+ Specifies a list of variables that mypy will treat as
351
357
compile-time constants that are always false.
352
358
353
359
@@ -357,10 +363,10 @@ Incremental mode
357
363
For more information, see the :ref: `incremental mode <incremental >`
358
364
section of the command line docs.
359
365
360
- ``incremental `` (bool, default True)
366
+ ``incremental `` (bool, default True)
361
367
Enables :ref: `incremental mode <incremental >`.
362
368
363
- ``cache_dir `` (string, default ``.mypy_cache ``)
369
+ ``cache_dir `` (string, default ``.mypy_cache ``)
364
370
Specifies the location where mypy stores incremental cache info.
365
371
Note that the cache is only read when incremental mode is enabled
366
372
but is always written to, unless the value is set to ``/dev/nul ``
@@ -378,7 +384,7 @@ Configuring error messages
378
384
For more information, see the :ref: `configuring error messages <configuring-error-messages >`
379
385
section of the command line docs.
380
386
381
- ``show_error_context `` (bool, default False)
387
+ ``show_error_context `` (bool, default False)
382
388
Prefixes each error with the relevant context.
383
389
384
390
``show_column_numbers `` (bool, default False)
@@ -397,7 +403,7 @@ section of the command line docs.
397
403
``show_traceback `` (bool, default False)
398
404
Shows traceback on fatal error.
399
405
400
- ``custom_typing_module `` (string)
406
+ ``custom_typing_module `` (string)
401
407
Specifies a custom module to use as a substitute for the ``typing `` module.
402
408
403
409
``custom_typeshed_dir `` (string)
@@ -425,5 +431,3 @@ Miscellaneous
425
431
426
432
``verbosity `` (integer, default 0)
427
433
Controls how much debug output will be generated. Higher numbers are more verbose.
428
-
429
-
0 commit comments