File tree Expand file tree Collapse file tree 5 files changed +14
-11
lines changed Expand file tree Collapse file tree 5 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -372,7 +372,7 @@ definitions or calls.
372
372
373
373
.. option :: --untyped-calls-exclude
374
374
375
- This flag allows to selectively disable :option: `--disallow-untyped-calls `
375
+ This flag allows one to selectively disable :option: `--disallow-untyped-calls `
376
376
for functions and methods defined in specific packages, modules, or classes.
377
377
Note that each exclude entry acts as a prefix. For example (assuming there
378
378
are no type annotations for ``third_party_lib `` available):
@@ -562,7 +562,7 @@ potentially problematic or redundant in some way.
562
562
563
563
.. option :: --deprecated-calls-exclude
564
564
565
- This flag allows to selectively disable :ref: `deprecated<code-deprecated> ` warnings
565
+ This flag allows one to selectively disable :ref: `deprecated<code-deprecated> ` warnings
566
566
for functions and methods defined in specific packages, modules, or classes.
567
567
Note that each exclude entry acts as a prefix. For example (assuming ``foo.A.func `` is deprecated):
568
568
Original file line number Diff line number Diff line change @@ -1003,8 +1003,8 @@ Warn about top level await expressions [top-level-await]
1003
1003
This error code is separate from the general ``[syntax] `` errors, because in
1004
1004
some environments (e.g. IPython) a top level ``await `` is allowed. In such
1005
1005
environments a user may want to use ``--disable-error-code=top-level-await ``,
1006
- that allows to still have errors for other improper uses of ``await ``, for
1007
- example:
1006
+ which allows one to still have errors for other improper uses of ``await ``,
1007
+ for example:
1008
1008
1009
1009
.. code-block :: python
1010
1010
Original file line number Diff line number Diff line change @@ -458,9 +458,12 @@ Example:
458
458
# Error: unused "type: ignore" comment
459
459
return a + b # type: ignore
460
460
461
- Note that due to a specific nature of this comment, the only way to selectively
462
- silence it, is to include the error code explicitly. Also note that this error is
463
- not shown if the ``# type: ignore `` is not used due to code being statically
461
+ Mypy errors can typically be silenced by putting a ``# type: ignore `` comment after them,
462
+ but because this is *already * a ``# type: ignore `` comment, the only way to selectively
463
+ silence it is to include the error code explicitly, making the comment
464
+ ``# type: ignore[unused-ignore] ``.
465
+
466
+ This error is not shown if the ``# type: ignore `` is not used due to code being statically
464
467
unreachable (e.g. due to platform or version checks).
465
468
466
469
Example:
Original file line number Diff line number Diff line change @@ -252,16 +252,16 @@ command.
252
252
Statically inspect expressions
253
253
******************************
254
254
255
- The daemon allows to get declared or inferred type of an expression (or other
255
+ The daemon allows one to get the declared or inferred type of an expression (or other
256
256
information about an expression, such as known attributes or definition location)
257
- using ``dmypy inspect LOCATION `` command. The location of the expression should be
257
+ using the ``dmypy inspect LOCATION `` command. The location of the expression should be
258
258
specified in the format ``path/to/file.py:line:column[:end_line:end_column] ``.
259
259
Both line and column are 1-based. Both start and end position are inclusive.
260
260
These rules match how mypy prints the error location in error messages.
261
261
262
262
If a span is given (i.e. all 4 numbers), then only an exactly matching expression
263
263
is inspected. If only a position is given (i.e. 2 numbers, line and column), mypy
264
- will inspect all * expressions *, that include this position, starting from the
264
+ will inspect all expressions that include this position, starting from the
265
265
innermost one.
266
266
267
267
Consider this Python code snippet:
Original file line number Diff line number Diff line change @@ -504,7 +504,7 @@ class ExtendedTraverserVisitor(TraverserVisitor):
504
504
In addition to the base traverser it:
505
505
* has visit_ methods for leaf nodes
506
506
* has common method that is called for all nodes
507
- * allows to skip recursing into a node
507
+ * allows skipping recursing into a node
508
508
509
509
Note that this traverser still doesn't visit some internal
510
510
mypy constructs like _promote expression and Var.
You can’t perform that action at this time.
0 commit comments