pypi cattrs 25.2.0
v25.2.0

one day ago
  • Potentially breaking: Sequences are now structured into tuples.
    This allows hashability, better immutability and is more consistent with the collections.abc.Sequence type. See Migrations for steps to restore legacy behavior. (#663)
  • Add a use_alias parameter to cattrs.Converter.
    cattrs.gen.make_dict_unstructure_fn_from_attrs, cattrs.gen.make_dict_unstructure_fn,
    cattrs.gen.make_dict_structure_fn_from_attrs, cattrs.gen.make_dict_structure_fn
    and cattrs.gen.typeddicts.make_dict_structure_fn will use the value for the use_alias parameter from the given converter by default now. If you're using these functions directly, the old behavior can be restored by passing in the desired value directly. (#596 #660)
  • The union passthrough strategy now by default accepts ints for unions that contain floats but not ints,
    when configured to be able to handle both ints and floats. This more closely matches the current typing behavior. (#656 #668)
  • Fix unstructuring of generic classes with stringified annotations. (#661 #662)
  • For cattrs.errors.StructureHandlerNotFoundError and cattrs.errors.ForbiddenExtraKeysError
    correctly set BaseException.args in super() and hence make them pickable. (#666)
  • The default disambiguation hook factory is now only enabled for converters with unstructure_strat=AS_DICT (the default).
    Since the strategy doesn't support tuples, it is skipped for unstructure_strat=AS_TUPLE converters. (#673)
  • Switch to uv and just in lieu of PDM, tox and Make. See the Contributing section for new workflow instructions. (#671)

New Contributors

Full Changelog: v25.1.1...v25.2.0

Don't miss a new cattrs release

NewReleases is sending notifications on new releases.