Skip to content

Commit

Permalink
Further improvement on typeguard_ignore() annotation (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
jolaf authored Oct 29, 2024
1 parent efa1166 commit c7f5a4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions docs/versionhistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Version history
This library adheres to
`Semantic Versioning 2.0 <https://semver.org/#semantic-versioning-200>`_.

- 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
Expand Down
4 changes: 2 additions & 2 deletions src/typeguard/_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c7f5a4f

Please sign in to comment.