Tin Tvrtković
82ea73cb47
Compatibility fixes. ( #193 )
...
* Restore hash to validators.
* Restore Attribute.default and Attribute.validator.
* _AndValidator is hashable now. Test validator hashability.
* Add in_ to validators.__all__.
2017-05-19 11:31:00 -07:00
Hynek Schlawack
a328e67169
Add takes_self to Factory and @_CountingAttr.default ( #189 )
...
* Add takes_self to Factory and @_CountingAttr.default
Fixes #165
* Add dark @Tinche magic
2017-05-16 09:36:39 +02:00
Hynek Schlawack
f560500886
Fix hashing behavior ( #142 )
2017-02-19 09:51:43 +01:00
Hynek Schlawack
37d38c4dc3
Allow inline definitions of validators using a decorator
...
Also make previous changes for multiple validators backward-compatible.
2017-02-11 16:56:56 +01:00
Tin Tvrtković
0c8211d922
Feature/better simple classes ( #119 )
2016-12-05 09:50:50 +01:00
Hynek Schlawack
b0942e1b2e
Add str argument to @attr.s
...
Fixes #112
2016-11-20 15:52:11 +01:00
Hynek Schlawack
3964f9d37b
Rename __post_init__ to __attrs_post_init__
...
This makes it clearer its coming from attrs and is consistent with
__attrs__attrs__.
2016-11-20 14:39:34 +01:00
Hynek Schlawack
7e4cecdac2
Minor tweaks
2016-11-20 14:30:29 +01:00
Tommy Beadle
3dc5fb0a5a
Add ability for ``__post_init__`` method to be defined.
...
If this method is defined for a class, it will get executed at the end
of ``__init__``. Previously, there was no way to extend what was
done during ``__init__`` when using ``@attr.s``.
2016-11-20 14:05:34 +01:00
Tin Tvrtković
0fac9215b8
Introduce attribute metadata. ( #96 )
2016-11-19 09:47:03 +01:00
inso
1b419e304b
Add attr.astuple
...
Fixes #77 and fixes #78
2016-09-11 08:55:30 +02:00
Tin Tvrtković
1897dfdf19
Improve tests, bandage assoc
...
Refactored and documented the simple_classes strategy. Applied the strategy to
assoc tests.
2016-09-10 08:40:47 +02:00
Tin Tvrtković
a7ba5122f6
Speed up Attribute instantiation. ( #70 )
2016-08-24 11:30:25 +02:00
Tin Tvrtković
dd4140ebcd
Optimize init validators. ( #64 )
2016-08-22 16:35:08 +02:00
Hynek Schlawack
b337f5b9d5
Move test helpers into an utils module
...
__init__.py should never contain any code.
2016-08-15 15:27:13 +02:00