Typeguard

Latest version: v4.4.2

Safety actively analyzes 723177 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 7 of 12

2.7.0

- Added support for ``typing.Protocol`` subclasses
- Added support for ``typing.AbstractSet``
- Fixed the handling of ``total=False`` in ``TypedDict``
- Fixed no error reported on unknown keys with ``TypedDict``
- Removed support of default values in ``TypedDict``, as they are not supported in the spec

2.6.1

- Fixed import errors when using the import hook and trying to import a module that has both a
module docstring and ``__future__`` imports in it
- Fixed ``AttributeError`` when using ``typechecked`` on a metaclass
- Fixed ``typechecked`` compatibility with built-in function wrappers
- Fixed type checking generator wrappers not being recognized as generators
- Fixed resolution of forward references in certain cases (inner classes, function-local classes)
- Fixed ``AttributeError`` when a class has contains a variable that is an instance of a class
that has a ``__call__()`` method
- Fixed class methods and static methods being wrapped incorrectly when ``typechecked`` is applied
to the class
- Fixed ``AttributeError`` when ``typechecked`` is applied to a function that has been decorated
with a decorator that does not properly wrap the original (PR by Joel Beach)
- Fixed collections with mixed value (or key) types raising ``TypeError`` on Python 3.7+ when
matched against unparametrized annotations from the ``typing`` module
- Fixed inadvertent ``TypeError`` when checking against a type variable that has constraints or
a bound type expressed as a forward reference

2.6.0

- Added a :pep:`302` import hook for annotating functions and classes with ``typechecked``
- Added a pytest plugin that activates the import hook
- Added support for ``typing.TypedDict``
- Deprecated ``TypeChecker`` (will be removed in v3.0)

2.5.1

- Fixed incompatibility between annotated ``Iterable``, ``Iterator``, ``AsyncIterable`` or
``AsyncIterator`` return types and generator/async generator functions
- Fixed ``TypeError`` being wrapped inside another TypeError (PR by russok)

2.5.0

- Added yield type checking via ``TypeChecker`` for regular generators
- Added yield, send and return type checking via ``typechecked`` for regular and async generators
- Silenced ``TypeChecker`` warnings about async generators
- Fixed bogus ``TypeError`` on ``Type[Any]``
- Fixed bogus ``TypeChecker`` warnings when an exception is raised from a type checked function
- Accept a ``bytearray`` where ``bytes`` are expected, as per `python/typing552`_
- Added policies for dealing with unmatched forward references
- Added support for using ``typechecked`` as a class decorator
- Added ``check_return_type()`` to accompany ``check_argument_types()``
- Added Sphinx documentation

.. _python/typing552: https://github.com/python/typing/issues/552

2.4.1

- Fixed broken packaging configuration

Page 7 of 12

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.