Releases: agronholm/typeguard
Releases · agronholm/typeguard
4.5.1
4.5.0
- Restored the
check_argument_types()andcheck_return_type()functions that were dropped in v3.0.0, for users who want more fine-grained control over run-time type checking (#437) - Added support for
extra_itemsinTypedDict, allowing users to specify the types for the values of "leftover" keys in a typed dict (keys that weren't explicitly defined in theTypedDictsubclass) (#538) - Fixed
NameErrorwhen evaluating forward references on Python 3.14 (#536; PR by @dionhaefner) - Fixed protocol check incorrectly rejecting inherited classmethods and staticmethods (#539)
- Fixed missing
TypeCheckErrorwhen checkingTypedDictwithRequired[...]annotations (#533; PR by @dionhaefner) - Fixed type aliases (e.g.
type Foo = list[int]) not being resolved during type checking (#526) - Fixed type-checked assignments to a single tuple target (e.g.
x, = ("foo",)) falsely raisingTypeCheckedError(#535)
4.4.4
4.4.3
4.4.2
- Fixed
TypeCheckErrorin unpacking assignment involving properties of a parameter of the function (#506; regression introduced in v4.4.1) - Fixed display of module name for forward references (#492; PR by @JelleZijlstra)
- Fixed
TypeErrorwhen using an assignment expression (#510; PR by @JohannesK71083) - Fixed
ValueError: no signature found for builtinwhen checking against a protocol and a matching attribute in the subject is a built-in function (#504)
4.4.1
- Dropped Python 3.8 support
- Changed the signature of
typeguard_ignore()to be compatible withtyping.no_type_check()(PR by @jolaf) - Avoid creating reference cycles when type checking uniontypes and classes
- Fixed checking of variable assignments involving tuple unpacking (#486)
- Fixed
TypeErrorwhen checking a class againsttype[Self](#481) - Fixed checking of protocols on the class level (against
type[SomeProtocol]) (#498) - Fixed
Selfchecks in instance/class methods that have positional-only arguments - Fixed explicit checks of PEP 604 unions against
types.UnionType(#467) - Fixed checks against annotations wrapped in
NotRequirednot being run unless theNotRequiredis a forward reference (#454)
4.4.0
- Added proper checking for method signatures in protocol checks (#465)
- Fixed basic support for intersection protocols (#490; PR by @antonagestam)
- Fixed protocol checks running against the class of an instance and not the instance itself (this produced wrong results for non-method member checks)
4.3.0
- Added support for checking against static protocols
- Fixed some compatibility problems when running on Python 3.13 (#460; PR by @JelleZijlstra)
- Fixed test suite incompatibility with pytest 8.2 (#461)
- Fixed pytest plugin crashing on pytest version older than v7.0.0 (even if it's just present) (#343)
4.2.1
4.2.0
- Added support for specifying options for the pytest plugin via pytest config files (#440)
- Avoid creating reference cycles when type checking unions (PR by Shantanu)
- Fixed
Optional[...]being removed from the AST if it was located within a subscript (#442) - Fixed
TypedDictfromtyping_extensionsnot being recognized as one (#443) - Fixed
typingtypes (dict[str, int],List[str], etc.) not passing checks againsttypeorType(#432, PR by Yongxin Wang) - Fixed detection of optional fields (
NotRequired[...]) inTypedDictwhen using forward references (#424) - Fixed mapping checks against Django's
MultiValueDict(#419)