Skip to content

0.13.0

Choose a tag to compare

@binaryDiv binaryDiv released this 15 Jun 12:17
· 4 commits to main since this release
982d722

Full changelog

This release further improves type checking with mypy by allowing type narrowing for UnsetValue. This means you can now test for value is not UnsetValue in conditions and the type of value will be correctly narrowed down to exclude UnsetValueType.

The release also introduces a small new validator and fixes a crash in the mypy plugin.

Added

  • AnyDictValidator: New validator that accepts arbitray dictionaries (as long as the keys are strings). #148

Changed

  • Change UnsetValueType to a single-value enum for better type narrowing of UnsetValue. #147

Fixed

  • mypy plugin: Add error handling for field cache misses by reporting a mypy error instead of crashing. #149
    • Previously an uncaught exception was raised when a field of a base class was not found in the field cache. Now the plugin will report a validataclass-internal-error instead, which gives the user better error messages and the possibility to silence the error until it is fixed upstream while still being able to use the plugin.
  • mypy plugin: Fix crash related to cache invalidation when using custom validataclass decorators. #149