You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@typing.no_type_check_decorator is nonfunctional #6583
$ mypy notypecheck.py
notypecheck.py:1: error: Module 'typing' has no attribute 'no_type_check_decorator'
notypecheck.py:8: error: Invalid type comment or annotation
I think this firstly needs a typeshed stub, but I think it won't work without special case support in mypy as well.
Also related: #607. I propose that we should reserve #607 for the issue that @no_type_check doesn't work for classes, and use this (new) issue for the "meta" decorator @no_type_check_decorator.
Can someone advise on how to track within mypy that a function acts as no_type_check? The current no_type_check appears to be handled via the hardcoded path in a few places.
Can someone advise on how to track within mypy that a function acts as no_type_check? The current no_type_check appears to be handled via the hardcoded path in a few places.
Although in general we don't like adding new flags to "important" nodes, it looks like in this case this is the only way (because the other way I see is keeping a global state, which is even worse). You can add a flag to FuncDef indicating whether this function can act as a no_type_check decorator, then check this flag on looked up node for every decorator that is a RefExpr.
Activity
gvanrossum commentedon Mar 22, 2019
Also related: #607. I propose that we should reserve #607 for the issue that
@no_type_checkdoesn't work for classes, and use this (new) issue for the "meta" decorator@no_type_check_decorator.lunixbochs commentedon Nov 26, 2019
There's now a typeshed stub: python/typeshed#3460 (comment)
lunixbochs commentedon Jan 21, 2020
Can someone advise on how to track within mypy that a function acts as no_type_check? The current no_type_check appears to be handled via the hardcoded path in a few places.
ilevkivskyi commentedon Jan 22, 2020
Although in general we don't like adding new flags to "important" nodes, it looks like in this case this is the only way (because the other way I see is keeping a global state, which is even worse). You can add a flag to
FuncDefindicating whether this function can act as ano_type_checkdecorator, then check this flag on looked up node for every decorator that is aRefExpr.Partial typeshed cherry-pick: Add `SupportsRichComparison` type to `_…
Cherry-pick some stub fixes from typeshed (#11739)
Cherry-pick some stub fixes from typeshed (python#11739)
AlexWaygood commentedon Jul 13, 2023
no_type_check_decoratorhas now been deprecated in Python 3.13, with removal scheduled for Python 3.15: python/cpython#106309.backends/bluezdbus: use dbus-fast typed annotations
backends/bluezdbus: use dbus-fast typed annotations