Skip to content

Commit

Permalink
Change specification of @no_type_check
Browse files Browse the repository at this point in the history
This is currently just a proposal, see
https://discuss.python.org/t/no-type-check-decorator/43119
  • Loading branch information
hauntsaninja committed Jan 15, 2024
1 parent 2142958 commit 53bca6c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/spec/directives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,14 @@ 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.
When applied to a function, ``@no_type_check`` indicates that static type
checkers should suppress all type-related errors within that function. From the
perspective of a caller, all of the function's parameters and return type are
always assumed to be Any, even if they are otherwise annotated or the type
checker would normally infer the return type.

When applied to a class, the behavior of ``@no_type_check`` unspecified;
static type checkers should feel free to ignore it.

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

0 comments on commit 53bca6c

Please sign in to comment.