# attrs 24.1.0 - Product: attrs (https://whatsnew.fyi/product/attrs) - Vendor: attrs - Date: 2024-08-03 - Version: 24.1.0 - Original notes: https://github.com/python-attrs/attrs/releases/tag/24.1.0 - Permalink: https://whatsnew.fyi/product/attrs/releases/24.1.0 What's New is an index, not a publisher: every entry below links to the vendor's own release notes, which are the authoritative source. Entries are labelled where they are hand-curated sample data, pre-releases, or drawn from a secondary source such as a developer blog. Reuse: release facts (products, versions, dates, links, CVE ids and flags) are open data under CC BY 4.0, from the API at https://whatsnew.fyi/api/v1 or the nightly dataset at https://github.com/whatsnew-fyi/dataset. The summaries, labels and curation are © What's New: quote freely with attribution and a link back; wholesale republication of them is not permitted — terms: https://whatsnew.fyi/terms. The vendors' own release notes remain their publishers'. --- Changes to check: - **Signature changed:** `attrs.evolve()` → `Pass it as the first positional argument instead.` (inferred by a model) - **Removed:** `attrs.validators.provides()` (inferred by a model) - **Removed:** `attrs.__url__` → `importlib.metadata` (inferred by a model) - **Behavior changed:** `__eq__` (inferred by a model) - **Deprecated:** `repr_ns` (from the vendor's deprecations section) - **Deprecated:** `hash` → `unsafe_hash` (from the vendor's deprecations section) - **removed** — Remove attrs.evolve() acceptance of inst argument as a keyword argument; pass it as the first positional argument instead - **removed** — Remove attrs.validators.provides() - **removed** — Remove all packaging metadata except __version__ and __version_info__ from attr and attrs modules - **changed** — Speed up generated __eq__ methods by generating a chain of attribute comparisons instead of constructing and comparing tuples - **deprecated** — Deprecate repr_ns argument to attr.s - **deprecated** — Deprecate hash argument to @attr.s, @attrs.define, and make_class() in favor of unsafe_hash - **changed** — Allow original slotted functools.cached_property classes to be cleaned by garbage collection - **changed** — Allow super() calls in slotted cached properties - **changed** — Update type stubs to use modern type notation and organize them so VS Code's quick-fix prefers the attrs namespace - **changed** — Preserve AttributeError raised by properties of slotted classes with functools.cached_properties - **added** — Wrap a converter into attrs.Converter to receive the current instance and/or the current field definition in the converter callable - **added** — Add __attrs_init_subclass__ as a replacement for __init_subclass__ ##### Highlights This release comes severely delayed, but comes with many exciting new features, bugfixes, and performance optimizations! The most notable is probably the possibility to receive `self` and field definitions in your converters by wrapping them into a [attrs.Converter](https://www.attrs.org/en/stable/api.html#attrs.Converter). The other big thing is our own replacement for `__init_subclass__` called (you guessed it) `__attrs_init_subclass__`. Check out the [docs](https://www.attrs.org/en/stable/init.html#attrs-and-init-subclass), if you're not sure what this is good for. Finally, we've made more important steps to promote our "new" APIs (can you believe they're 4 years old!?) in the docs. If we missed anything, please let us know. *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 and check out the sweet perks! ###### Above and Beyond [Variomedia AG](https://www.variomedia.de/) (@[variomedia](https://github.com/variomedia)), [Tidelift](https://www.tidelift.com/) (@[tidelift](https://github.com/tidelift)), [FilePreviews](http://filepreviews.io/) (@[filepreviews](https://github.com/filepreviews)), [Klaviyo](https://www.klaviyo.com) (@[klaviyo](https://github.com/klaviyo)), Daniel Fortunov (@[asqui](https://github.com/asqui)), and Kevin P. Fleming (@[kpfleming](https://github.com/kpfleming)). ###### Maintenance Sustainers [Adam Hill](https://adamghill.com) (@[adamghill](https://github.com/adamghill)), Magnus Watn (@[magnuswatn](https://github.com/magnuswatn)), [David Cramer](http://cra.mr) (@[dcramer](https://github.com/dcramer)), Moving Content AG (@[moving-content](https://github.com/moving-content)), [ProteinQure](https://proteinqure.com/) (@[ProteinQure](https://github.com/ProteinQure)), Jesse Snyder (@[jessesnyder](https://github.com/jessesnyder)), [Rivo Laks](https://rivolaks.com) (@[rivol](https://github.com/rivol)), [The Westervelt Company](https://westervelt.com) (@[westerveltco](https://github.com/westerveltco)), Philippe Galvan (@[PhilippeGalvan](https://github.com/PhilippeGalvan)), [Birk Jernström](https://polar.sh) (@[birkjernstrom](https://github.com/birkjernstrom)), Chris Withers (@[cjw296](https://github.com/cjw296)), [Christopher Dignam](https://christopher.xyz) (@[chdsbd](https://github.com/chdsbd)), [Stefan Hagen](https://stefan-hagen.website) (@[sthagen](https://github.com/sthagen)), [Sławomir Ehlert](https://slafs.net) (@[slafs](https://github.com/slafs)), Mostafa Khalil (@[khadrawy](https://github.com/khadrawy)), [Filip Mularczyk](https://fmularczyk.pl) (@[mukiblejlok](https://github.com/mukiblejlok)), [Mike Fiedler](https://mike.fiedler.me) (@[miketheman](https://github.com/miketheman)), Thomas Klinger (@[thmsklngr](https://github.com/thmsklngr)), Duncan Hill (@[cricalix](https://github.com/cricalix)), Colin Marquardt (@[cmarqu](https://github.com/cmarqu)), and [Andreas Poehlmann](https://poehlmann.io) (@[ap--](https://github.com/ap--)). Not to forget 7 more amazing humans who chose to be generous but anonymous! ##### Full Changelog ###### Backwards-incompatible Changes - `attrs.evolve()` doesn't accept the *inst* argument as a keyword argument anymore. Pass it as the first positional argument instead. [\#1264](https://github.com/python-attrs/attrs/issues/1264) - `attrs.validators.provides()` has been removed. The removed code is available as a [gist](https://gist.github.com/hynek/9eaaaeb659808f3519870dfa16d2b6b2) for convenient copy and pasting. [\#1265](https://github.com/python-attrs/attrs/issues/1265) - All packaging metadata except from `__version__` and `__version_info__` has been removed from the `attr` and `attrs` modules (for example, `attrs.__url__`). Please use [`importlib.metadata`](https://docs.python.org/3/library/import _[Truncated at 4000 characters — full notes: https://github.com/python-attrs/attrs/releases/tag/24.1.0]_