It's been a lot busier than the changelog indicates, but a lot of the work happened under the hood (like some impressive performance improvements). But we've got still one big new feature that's are worthy the holidays:
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!
Python 3.6 is now deprecated and support will be removed in the next release. #1017
Changes
attrs.field() now supports an alias option for explicit __init__ argument names.
Get __init__ signatures matching any taste, peculiar or plain! The PEP 681 compatiblealias option can be use to override private attribute name mangling, or add other arbitrary field argument name overrides. #950
attrs.NOTHING is now an enum value, making it possible to use with e.g. typing.Literal. #983
Added missing re-import of attr.AttrsInstance to the attrs namespace. #987
Fix slight performance regression in classes with custom __setattr__ and speedup even more. #991
Class-creation performance improvements by switching performance-sensitive templating operations to f-strings.
You can expect an improvement of about 5% -- even for very simple classes. #995
Python 3.6 is now deprecated and support will be removed in the next release.
#1017
Changes
attrs.field() now supports an alias option for explicit __init__ argument names.
Get __init__ signatures matching any taste, peculiar or plain!
The PEP 681 compatiblealias option can be use to override private attribute name mangling, or add other arbitrary field argument name overrides.
#950
attrs.NOTHING is now an enum value, making it possible to use with e.g. typing.Literal.
#983
Added missing re-import of attr.AttrsInstance to the attrs namespace.
#987
Fix slight performance regression in classes with custom __setattr__ and speedup even more.
#991
Class-creation performance improvements by switching performance-sensitive templating operations to f-strings.
You can expect an improvement of about 5% -- even for very simple classes.
#995
attrs.has() is now a TypeGuard for AttrsInstance.
That means that type checkers know a class is an instance of an attrs class if you check it using attrs.has() (or attr.has()) first.
#997
Made attrs.AttrsInstance stub available at runtime and fixed type errors related to the usage of attrs.AttrsInstance in Pyright.
#999
On Python 3.10 and later, call abc.update_abstractmethods() on dict classes after creation.
This improves the detection of abstractness.
#1001
attrs's pickling methods now use dicts instead of tuples.
That is safer and more robust across different versions of a class.
#1009
Added attrs.validators.not_(wrapped_validator) to logically invert wrapped_validator by accepting only values where wrapped_validator rejects the value with a ValueError or TypeError (by default, exception types configurable).
#1010
The type stubs for attrs.cmp_using() now have default values.
#1027
To conform with PEP 681, attr.s() and attrs.define() now accept unsafe_hash in addition to hash.
#1065
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps attrs from 22.1.0 to 22.2.0.
Release notes
Sourced from attrs's releases.
... (truncated)
Changelog
Sourced from attrs's changelog.
Commits
a9960de
Prepare 22.2.0566248a
Don't linkcheck tree links0f62805
Make towncrier marker independent from warningb9f35eb
Fix minor stub issues (#1072)4ad4ea0
Use MyST-native include519423d
Use MyST-native doctest blocks in all MD403adab
Remove stray file6957e4a
Use new typographic branding in the last rst file, too1bb2864
Convert examples.rst to mdc1c24cc
Convert glossary.rst to mdDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)