Link [ pkgsrc | NetBSD | pkgsrc git mirror | PR fulltext-search | netbsd commit viewer ]


   
        usage: [branch:branch] [user:user] [path[@revision]] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN pkgtools/pkg)




switch to index mode

recent branches: MAIN (1h)  pkgsrc-2024Q1 (9d)  pkgsrc-2023Q4 (56d)  pkgsrc-2023Q2 (88d)  pkgsrc-2023Q3 (168d) 

2024-05-26 20:13:37 UTC Now

2017-05-20 06:01:46 UTC MAIN commitmail json YAML

Changes 17.1.0:
Backward-incompatible changes:
* attrs will set the __hash__() method to None by default now. The way hashes were handled before was in conflict with Python窶冱 specification. This may break some software although this breakage is most likely just surfacing of latent bugs. You can always make attrs create the __hash__() method using @attr.s(hash=True).
* Correspondingly, attr.ib窶�s hash argument is None by default too and mirrors the cmp argument as it should.

Deprecations:
* attr.assoc() is now deprecated in favor of attr.evolve() and will stop working in 2018.

Changes:
Fix default hashing behavior. Now hash mirrors the value of cmp and classes are unhashable by default.
Added attr.evolve() that, given an instance of an attrs class and field changes as keyword arguments, will instantiate a copy of the given instance with the changes applied. evolve() replaces assoc(), which is now deprecated. evolve() is significantly faster than assoc(), and requires the class have an initializer that can take the field values as keyword arguments (like attrs itself can generate).
FrozenInstanceError is now raised when trying to delete an attribute from a frozen class.
Frozen-ness of classes is now inherited.
__attrs_post_init__() is now run if validation is disabled.
Added attr.validators.in_(options) that, given the allowed options, checks whether the attribute value is in it. This can be used to check constants, enums, mappings, etc.
Added attr.validators.and_() that composes multiple validators into one.
For convenience, the validator argument of @attr.s now can take a list of validators that are wrapped using and_().
Accordingly, attr.validators.optional() now can take a list of validators too.
Validators can now be defined conveniently inline by using the attribute as a decorator. Check out the examples to see it in action!
attr.Factory() now has a takes_self argument that makes the initializer to pass the partially initialized instance into the factory. In other words you can define attribute defaults based on other attributes.
Default factories can now also be defined inline using decorators. They are always passed the partially initialized instance.
Conversion can now be made optional using attr.converters.optional().
attr.make_class() now accepts the keyword argument bases which allows for subclassing.
Metaclasses are now preserved with slots=True.

(adam)