Skip to content

Commit 0f5e998

Browse files
ilevkivskyigvanrossum
authored andcommitted
Tweak the scope of type: ignore comment (#114)
Fixes python/typing#292
1 parent 3ff642e commit 0f5e998

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pep-0484.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ The meaning of annotations
102102

103103
Any function without annotations should be treated as having the most
104104
general type possible, or ignored, by any type checker. Functions
105-
with the ``@no_type_check`` decorator or with a ``# type: ignore``
106-
comment should be treated as having no annotations.
105+
with the ``@no_type_check`` decorator should be treated as having
106+
no annotations.
107107

108108
It is recommended but not required that checked functions have
109109
annotations for all arguments and the return type. For a checked
@@ -1349,8 +1349,10 @@ error refers to::
13491349
'not_found': http.client.NOT_FOUND # type: ignore
13501350
}
13511351

1352-
A ``# type: ignore`` comment on a line by itself disables all type
1353-
checking for the rest of the file.
1352+
A ``# type: ignore`` comment on a line by itself is equivalent to
1353+
adding an inline ``# type: ignore`` to each line until the end of
1354+
the current indented block. At top indentation level this has
1355+
effect of disabling type checking until the end of file.
13541356

13551357
If type hinting proves useful in general, a syntax for typing variables
13561358
may be provided in a future Python version.

0 commit comments

Comments
 (0)