Upgrading attrs 21 to 22
Review needed21.4.0 → 22.2.0Other2
Review neededUpgrade verdict
A major version jump with sparse notes. Read the release notes before upgrading.
In plain terms
- Nothing in this range needs changes to your code. It adds features and fixes.
Must act Nothing to change
No breaking, platform, security or deprecated items in this range.
Python requirement changed in 22.2.0: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* → >=3.6.
Nothing in this upgrade needs a code or configuration change.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- changed:
function asdict(inst: Any, recurse: bool=…, filter: Optional[_FilterType[Any]]=…, dict_factory: Type[Mapping[Any, Any]]=…, retain_collection_types: bool=…, value_serializer: Optional[Callable[[type, Attribute[Any], Any], Any]]=…, tuple_keys: Optional[bool]=…) -> Dict[str, Any] → function asdict(inst: AttrsInstance, recurse: bool=…, filter: Optional[_FilterType[Any]]=…, dict_factory: Type[Mapping[Any, Any]]=…, retain_collection_types: bool=…, value_serializer: Optional[Callable[[type, Attribute[Any], Any], Any]]=…, tuple_keys: Optional[bool]=…) -> Dict[str, Any] - changed:
function astuple(inst: Any, recurse: bool=…, filter: Optional[_FilterType[Any]]=…, tuple_factory: Type[Sequence[Any]]=…, retain_collection_types: bool=…) -> Tuple[Any, ...] → function astuple(inst: AttrsInstance, recurse: bool=…, filter: Optional[_FilterType[Any]]=…, tuple_factory: Type[Sequence[Any]]=…, retain_collection_types: bool=…) -> Tuple[Any, ...] - changed:
function attrib(default: None=…, validator: None=…, repr: _ReprArgType=…, cmp: Optional[_EqOrderType]=…, hash: Optional[bool]=…, init: bool=…, metadata: Optional[Mapping[Any, Any]]=…, type: None=…, converter: None=…, factory: None=…, kw_only: bool=…, eq: Optional[_EqOrderType]=…, order: Optional[_EqOrderType]=…, on_setattr: Optional[_OnSetAttrArgType]=…) -> Any | (default: None=…, validator: Opti… → function attrib(default: None=…, validator: None=…, repr: _ReprArgType=…, cmp: Optional[_EqOrderType]=…, hash: Optional[bool]=…, init: bool=…, metadata: Optional[Mapping[Any, Any]]=…, type: None=…, converter: None=…, factory: None=…, kw_only: bool=…, eq: Optional[_EqOrderType]=…, order: Optional[_EqOrderType]=…, on_setattr: Optional[_OnSetAttrArgType]=…, alias: Optional[str]=…) -> Any | (default:… - changed:
function define(maybe_cls: _C, *, these: Optional[Dict[str, Any]]=…, repr: bool=…, hash: Optional[bool]=…, init: bool=…, slots: bool=…, frozen: bool=…, weakref_slot: bool=…, str: bool=…, auto_attribs: bool=…, kw_only: bool=…, cache_hash: bool=…, auto_exc: bool=…, eq: Optional[bool]=…, order: Optional[bool]=…, auto_detect: bool=…, getstate_setstate: Optional[bool]=…, on_setattr: Optional[_OnSetAtt… → function define(maybe_cls: _C, *, these: Optional[Dict[str, Any]]=…, repr: bool=…, unsafe_hash: Optional[bool]=…, hash: Optional[bool]=…, init: bool=…, slots: bool=…, frozen: bool=…, weakref_slot: bool=…, str: bool=…, auto_attribs: bool=…, kw_only: bool=…, cache_hash: bool=…, auto_exc: bool=…, eq: Optional[bool]=…, order: Optional[bool]=…, auto_detect: bool=…, getstate_setstate: Optional[bool]=…,… - changed:
function field(*, default: None=…, validator: None=…, repr: _ReprArgType=…, hash: Optional[bool]=…, init: bool=…, metadata: Optional[Mapping[Any, Any]]=…, converter: None=…, factory: None=…, kw_only: bool=…, eq: Optional[bool]=…, order: Optional[bool]=…, on_setattr: Optional[_OnSetAttrArgType]=…) -> Any | (*, default: None=…, validator: Optional[_ValidatorArgType[_T]]=…, repr: _ReprArgType=…, has… → function field(*, default: None=…, validator: None=…, repr: _ReprArgType=…, hash: Optional[bool]=…, init: bool=…, metadata: Optional[Mapping[Any, Any]]=…, converter: None=…, factory: None=…, kw_only: bool=…, eq: Optional[bool]=…, order: Optional[bool]=…, on_setattr: Optional[_OnSetAttrArgType]=…, alias: Optional[str]=…) -> Any | (*, default: None=…, validator: Optional[_ValidatorArgType[_T]]=…, r… - changed:
function fields(cls: type) -> _Fields → function fields(cls: Type[AttrsInstance]) -> Any - changed:
function fields_dict(cls: type) -> Dict[str, Attribute[Any]] → function fields_dict(cls: Type[AttrsInstance]) -> Dict[str, Attribute[Any]] - changed:
function has(cls: type) -> bool → function has(cls: type) -> TypeGuard[Type[AttrsInstance]] - changed:
function validate(inst: Any) -> None → function validate(inst: AttrsInstance) -> None - changed:
variable NOTHING: object → variable NOTHING - added:
class AttrsInstance(AttrsInstance_, Protocol) - added:
export AttrsInstance_ - added:
export cmp_using - added:
field Attribute.alias: Optional[str]
- changed:
function deep_iterable(member_validator: _ValidatorType[_T], iterable_validator: Optional[_ValidatorType[_I]]=…) -> _ValidatorType[_I] → function deep_iterable(member_validator: _ValidatorArgType[_T], iterable_validator: Optional[_ValidatorType[_I]]=…) -> _ValidatorType[_I] - added:
function min_len(length: int) -> _ValidatorType[_T] - added:
function not_(validator: _ValidatorType[_T], *, msg: Optional[str]=…, exc_types: Union[Type[Exception], Iterable[Type[Exception]]]=…) -> _ValidatorType[_T]