no_type_check_decorator doesn't work (original) (raw)

The no_type_check_decorator is supposed to let you give the effect of no_type_check to other decorators. pytype doesn't appear to understand it:

from typing import no_type_check_decorator

@no_type_check_decorator def test(cls): return cls

@test class Foo: x: 5

Gives:

File "/tmp/type_test3.py", line 15, in Foo: Invalid type annotation '5' for x [invalid-annotation]
  Not a type

mypy is also currently lacking support, they discuss it probably needing special case support directly in the checker.