Merge pull request #29 from cournape/speedup_construction

ENH: query attributes through private API to speed up validate.
This commit is contained in:
Hynek Schlawack 2015-10-16 11:01:35 +02:00
commit 140c8c9288
3 changed files with 3 additions and 2 deletions

View File

@ -10,6 +10,7 @@ Its the spiritual successor of `characteristic <https://characteristic.readth
The following folks helped forming ``attrs`` into what it is now:
- `David Cournapeau <https://github.com/cournape/>`_
- `Glyph <https://github.com/glyph/>`_
- `HawkOwl <https://github.com/hawkowl>`_
- `Lynn Root <https://github.com/econchick>`_

View File

@ -390,7 +390,7 @@ def validate(inst):
if _config._run_validators is False:
return
for a in fields(inst.__class__):
for a in inst.__class__.__attrs_attrs__:
if a.validator is not None:
a.validator(inst, a, getattr(inst, a.name))

View File

@ -16,7 +16,7 @@ The third digit is only for regressions.
Changes:
^^^^^^^^
None
- speed up object creation when attribute validators are used `[28] <https://github.com/hynek/attrs/issues/28>`_
15.1.0 (2015-08-20)