# attrs 23.1.0 - Product: attrs (https://whatsnew.fyi/product/attrs) - Vendor: attrs - Date: 2023-04-16 - Version: 23.1.0 - Original notes: https://github.com/python-attrs/attrs/releases/tag/23.1.0 - Permalink: https://whatsnew.fyi/product/attrs/releases/23.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: - **Requirement raised:** `Python 3.6` → `3.7` (inferred by a model) - **Deprecated:** `attrs.validators.provides` (from the vendor's deprecations section) - **Deprecated:** `inst` (inferred by a model) - **Behavior changed:** `attrs.resolve_types()` (inferred by a model) - **removed** — Python 3.6 support has been dropped - **changed** — Packaging switched to static package data using Hatch - **deprecated** — Support for zope-interface via the attrs.validators.provides validator is deprecated and will be removed in or after April 2024 - **changed** — attrs.filters.exclude() and attrs.filters.include() now support passing attribute names as strings - **changed** — attrs.has() and attrs.fields() now handle generic classes correctly - **fixed** — Fix frozen exception classes when raised within contextlib.contextmanager which mutates their __traceback__ attributes - **changed** — attrs.frozen now works with type checkers that implement PEP-681 - **fixed** — Restored ability to unpickle instances pickled before 22.2.0 - **changed** — attrs.asdict() and attrs.astuple() type stubs now accept the attrs.AttrsInstance protocol - **fixed** — Fix slots class cellvar updating closure in CPython 3.8+ even when __code__ introspection is unavailable - **changed** — attrs.resolve_types() can now pass include_extras to typing.get_type_hints() on Python 3.9+ and does so by default - **added** — Added type parameter to attrs.field() function for use with attrs.make_class() - **changed** — attrs.evolve() can now change fields named inst if the instance is passed as a positional argument - **deprecated** — Passing the instance to attrs.evolve() using the inst keyword argument is deprecated and will be removed in or after April 2024 - **changed** — attrs.validators.optional() now also accepts a tuple of validators in addition to lists of validators ##### Highlights A lot of features and smaller bug fixes! But also with a heavy heart, we're leaving the last `dataclass`-less Python version (3.6) behind, but don't worry: the old versions aren't going anywhere and thanks to the magic of package metadata, `pip install attrs` should still work on Python 3.6 as if nothing happened. ##### 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), [Tidelift](https://www.tidelift.com/) (@tidelift), [Sentry](https://sentry.io) (@getsentry), [HiredScore](https://hiredscore.com) (@HiredScore), [FilePreviews](http://filepreviews.io/) (@filepreviews), and Daniel Fortunov (@asqui). ###### Maintenance Sustainers [Adam Hill](https://adamghill.com) (@adamghill), Dan Groshev (@si14), Magnus Watn (@magnuswatn), [David Cramer](http://cra.mr) (@dcramer), Moving Content AG (@moving-content), [Stein Magnus Jodal](https://jod.al) (@jodal), [ProteinQure](https://proteinqure.com/) (@ProteinQure), Jesse Snyder (@jessesnyder), [Rivo Laks](https://rivolaks.com) (@rivol), [Tom Ballinger](http://ballingt.com/) (@thomasballinger), @medecau, [Ionel Cristian Mărieș](https://blog.ionelmc.ro) (@ionelmc), [The Westervelt Company](https://westervelt.com) (@westerveltco), Philippe Galvan (@PhilippeGalvan), Birk Jernström (@birkjernstrom), [Tim Schilling](www.better-simple.com) (@tim-schilling), Chris Withers (@cjw296), [Christopher Dignam](https://christopher.xyz) (@chdsbd), and [Stefan Hagen](https://stefan-hagen.website) (@sthagen). Not to forget 3 more amazing humans who chose to be generous but anonymous! ##### Full Changelog ###### Backwards-incompatible Changes - Python 3.6 has been dropped and packaging switched to static package data using [Hatch](https://hatch.pypa.io/latest/). [\#993](https://github.com/python-attrs/attrs/issues/993) ###### Deprecations - The support for *zope-interface* via the `attrs.validators.provides` validator is now deprecated and will be removed in, or after, April 2024. The presence of a C-based package in our developement dependencies has caused headaches and we're not under the impression it's used a lot. Let us know if you're using it and we might publish it as a separate package. [\#1120](https://github.com/python-attrs/attrs/issues/1120) ###### Changes - `attrs.filters.exclude()` and `attrs.filters.include()` now support the passing of attribute names as strings. [\#1068](https://github.com/python-attrs/attrs/issues/1068) - `attrs.has()` and `attrs.fields()` now handle generic classes correctly. [\#1079](https://github.com/python-attrs/attrs/issues/1079) - Fix frozen exception classes when raised within e.g. `contextlib.contextmanager`, which mutates their `__traceback__` attributes. [\#1081](https://github.com/python-attrs/attrs/issues/1081) - `@frozen` now works with type checkers that implement [PEP-681](https://peps.python.org/pep-0681/) (ex. [pyright](https://github.com/microsoft/pyright/)). [\#1084](https://github.com/python-attrs/attrs/issues/1084) - Restored ability to unpickle instances pickled before 22.2.0. [\#1085](https://github.com/python-attrs/attrs/issues/1085) - `attrs.asdict()`'s and `attrs.astuple()`'s type stubs now accept the `attrs.AttrsInstance` protocol. [\#1090](https://github.com/python-attrs/attrs/issues/1090) - Fix slots class cellvar updating closure in CPython 3.8+ even when `__code__` introspection is unavailable. [\#1092](https://github.com/python-attrs/attrs/issues/1092) - `attrs.resolve_types()` can now pass `include_extras` to `typing.get_type_hints()` on Python 3.9+, and does so by default. [\#1099](https://github.com/python-attrs/attrs/issues/1099) - Added instructions for pull re _[Truncated at 4000 characters — full notes: https://github.com/python-attrs/attrs/releases/tag/23.1.0]_