Commit Graph

6 Commits

Author SHA1 Message Date
Hynek Schlawack 20c2d4fc0c
Optimize the case of on_setattr=validate & no validators (#817)
* Optimize the case of on_setattr=validate & no validators

This is important because define/mutable have on_setattr=setters.validate on
default.

Fixes #816

Signed-off-by: Hynek Schlawack <hs@ox.cx>

* Grammar
2021-05-17 09:24:46 +02:00
Antonio Botelho f580185cc4
Undeprecate cmp (#773)
* Document comparison

* Grammar

* Stress independence of eq/order

* Add example for eq

* Be consistent with fields

* Undeprecated cmp

* Update doc to remove cmp deprecation

* Reintroduced deprecation warning on Attribute cmp property

* Added changelog file

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-02-28 13:20:40 +01:00
Hynek Schlawack 83fef48b2d Ensure objects live long enough in hash test 2020-10-16 08:35:42 +02:00
Hynek Schlawack 106c33c205
Clear __setattr__ if it was inherited && written by us (#663)
Signed-off-by: Hynek Schlawack <hs@ox.cx>
2020-08-13 13:49:44 +02:00
Hynek Schlawack 2f6fd8516c
Add on_setattr hooks to attr.s and attr.ib (#660)
* Add on_setattr hooks to attr.s and attr.ib

Signed-off-by: Hynek Schlawack <hs@ox.cx>

* Add PR newsfragment

* Fix attr.s doc sig

* Make _DisableType private

* Mark setters.frozen as NoReturn

* Rename setters.DISABLE to setters.NO_OP to clarify its purpose

DISABLE sounds less purposeful and doesn't convey its meaning as well.

* Fix type

* Loosen up type for convert even further

* Tighten type a tiny bit
2020-07-20 12:43:10 +02:00
Hynek Schlawack 77914a4b27 Better name for functional tests 2020-06-10 08:38:52 +02:00