Typeguard

Latest version: v4.4.2

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

Scan your dependencies

Page 2 of 12

4.1.5

- Fixed ``Callable`` erroneously rejecting a callable that has the requested amount of
positional arguments but they have defaults
(`400 <https://github.com/agronholm/typeguard/issues/400>`_)
- Fixed a regression introduced in v4.1.4 where the elements of ``Literal`` got quotes
removed from them by the AST transformer
(`399 <https://github.com/agronholm/typeguard/issues/399>`_)

4.1.4

- Fixed ``AttributeError`` where the transformer removed elements from a PEP 604 union
(`384 <https://github.com/agronholm/typeguard/issues/384>`_)
- Fixed ``AttributeError: 'Subscript' object has no attribute 'slice'`` when
encountering an annotation with a subscript containing an ignored type (imported
within an ``if TYPE_CHECKING:`` block)
(`397 <https://github.com/agronholm/typeguard/issues/397>`_)
- Fixed type checking not being skipped when the target is a union (PEP 604 or
``typing.Union``) where one of the elements is an ignored type (shadowed by an
argument, variable assignment or an ``if TYPE_CHECKING`` import)
(`394 <https://github.com/agronholm/typeguard/issues/394>`_,
`395 <https://github.com/agronholm/typeguard/issues/395>`_)
- Fixed type checking of class instances created in ``__new__()`` in cases such as enums
where this method is already invoked before the class has finished initializing
(`398 <https://github.com/agronholm/typeguard/issues/398>`_)

4.1.3

- Dropped Python 3.7 support
- Fixed ``typechecked`` optimization causing compilation of instrumented code to fail
when any block was left empty by the AST transformer (eg ``if`` or
``try`` / ``except`` blocks)
(`352 <https://github.com/agronholm/typeguard/issues/352>`_)
- Fixed placement of injected typeguard imports with respect to ``__future__`` imports
and module docstrings (`385 <https://github.com/agronholm/typeguard/issues/385>`_)

4.1.2

- Fixed ``Any`` being removed from a subscript that still contains other elements
(`373 <https://github.com/agronholm/typeguard/issues/373>`_)

4.1.1

- Fixed ``suppress_type_checks()`` causing annotated variable assignments to always
assign ``None`` (`380 <https://github.com/agronholm/typeguard/issues/380>`_)

4.1.0

- Added support for passing a tuple as ``expected_type`` to ``check_type()``, making it
more of a drop-in replacement for ``isinstance()``
(`371 <https://github.com/agronholm/typeguard/issues/371>`_)
- Fixed regression where ``Literal`` inside a ``Union`` had quotes stripped from its
contents, thus typically causing ``NameError`` to be raised when run
(`372 <https://github.com/agronholm/typeguard/issues/372>`_)

Page 2 of 12

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.