Skip to content
This repository was archived by the owner on Sep 3, 2026. It is now read-only.
This repository was archived by the owner on Sep 3, 2026. It is now read-only.

no_type_check_decorator doesn't work #1452

Closed

Description

@jgarvin

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.

Activity

  1. martindemello commented on Jun 27, 2023

    @martindemello
    Contributor

    we would need special-case support directly in the checker too, since this is more of a type-checker directive than something that works with the existing type system.

  2. AlexWaygood commented on Jul 13, 2023

    @AlexWaygood
    Contributor

    Since no type checker added support for this decorator after 8 years of it being in the typing module, it has now been deprecated: python/cpython#106309.

  3. rchen152 commented on Jul 13, 2023

    @rchen152
    Contributor

    Thanks for the update! I'll close this issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions