Highlights
The main outward change here only affects people using field transformers, but it should be a nice quality of life improvement!
Full changelog below!
Special Thanks
This release would not be possible without my generous sponsors! Thank you to all of you making sustainable maintenance possible! If you would like to join them, go to https://github.com/sponsors/hynek and check out the sweet perks!
Above and Beyond
Variomedia AG (@variomedia), Tidelift (@tidelift), Kraken Tech (@kraken-tech), Privacy Solutions GmbH (@privacy-solutions), FilePreviews (@filepreviews), TestMu AI Open Source Office (Formerly LambdaTest) (@LambdaTest-Inc), Doist (@Doist), Daniel Fortunov (@asqui), and Kevin P. Fleming (@kpfleming).
Maintenance Sustainers
Buttondown (@buttondown), Christopher Dignam (@chdsbd), Magnus Watn (@magnuswatn), David Cramer (@dcramer), Rivo Laks (@rivol), Polar (@polarsource), Mike Fiedler (@miketheman), Duncan Hill (@cricalix), Colin Marquardt (@cmarqu), Pieter Swinkels (@swinkels), Nick Libertini (@libertininick), Brian M. Dennis (@crossjam), Celebrity News AG (@celebritynewsag), The Westervelt Company (@westerveltco), Sławomir Ehlert (@slafs), Mostafa Khalil (@khadrawy), Filip Mularczyk (@mukiblejlok), Thomas Klinger (@thmsklngr), Andreas Poehlmann (@ap--), August Trapper Bigelow (@atbigelow), Carlton Gibson (@carltongibson), and Roboflow (@roboflow).
Full Changelog
Backwards-incompatible Changes
- Field aliases are now resolved before calling
field_transformer, so transformers receive fully populatedAttributeobjects with usablealiasvalues instead ofNone. The newAttribute.alias_is_defaultflag indicates whether the alias was auto-generated (True) or explicitly set by the user (False). #1509
Changes
- Fix type annotations for
attrs.validators.optional(), so it no longer rejects tuples with more than one validator. #1496 - The
attrs.validators.disabled()contextmanager can now be nested. #1513 - Frozen classes can set
on_setattr=attrs.setters.NO_OPin addition toNone. #1515 - It's now possible to pass attrs instances in addition to attrs classes to
attrs.fields(). #1529
This release contains contributions from @bysiber, @DavidCEllis, @finite-state-machine, @hynek, @veeceey, and @vstinner.
Artifact Attestations
You can verify this release's artifact attestions using GitHub's CLI tool by downloading the sdist and wheel from PyPI and running:
$ gh attestation verify --owner python-attrs attrs-26.1.0.tar.gzand
$ gh attestation verify --owner python-attrs attrs-26.1.0-py3-none-any.whl