diff --git a/docs/versionhistory.rst b/docs/versionhistory.rst index 7ab922c..cb1563c 100644 --- a/docs/versionhistory.rst +++ b/docs/versionhistory.rst @@ -4,6 +4,9 @@ Version history This library adheres to `Semantic Versioning 2.0 `_. +- Changed the signature of ``typeguard_ignore()`` to be compatible with + ``typing.no_type_check()`` (PR by @jolaf) + **4.4.0** (2024-10-27) - Added proper checking for method signatures in protocol checks diff --git a/src/typeguard/_decorators.py b/src/typeguard/_decorators.py index af6f82b..1d171ec 100644 --- a/src/typeguard/_decorators.py +++ b/src/typeguard/_decorators.py @@ -21,9 +21,9 @@ if TYPE_CHECKING: from typeshed.stdlib.types import _Cell - def typeguard_ignore(f: T_CallableOrType) -> T_CallableOrType: + def typeguard_ignore(arg: T_CallableOrType) -> T_CallableOrType: """This decorator is a noop during static type-checking.""" - return f + return arg else: from typing import no_type_check as typeguard_ignore # noqa: F401