Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions docs/spec/directives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,16 @@ This approach may also be useful to handle import cycles.
``@no_type_check``
------------------

To mark portions of the program that should not be covered by type
hinting, you can use the ``@typing.no_type_check`` decorator on a class or function.
Functions with this decorator should be treated as having
no annotations.
The ``@typing.no_type_check`` decorator may be supported by type checkers
for functions and classes.

If a type checker supports the ``no_type_check`` decorator for functions, it
should suppress all type errors for the ``def`` statement and its body including
any nested functions or classes. It should also ignore all parameter
and return type annotations and treat the function as if it were unannotated.

The behavior for the ``no_type_check`` decorator when applied to a class is
left undefined by the typing spec at this time.

Version and platform checking
-----------------------------
Expand Down