Validate all attributes on *inst* that have a validator. Leaves all exceptions through. :param inst: Instance of a class with ``attrs`` attributes.
(inst)
| 2083 | |
| 2084 | |
| 2085 | def validate(inst): |
| 2086 | """ |
| 2087 | Validate all attributes on *inst* that have a validator. |
| 2088 | |
| 2089 | Leaves all exceptions through. |
| 2090 | |
| 2091 | :param inst: Instance of a class with ``attrs`` attributes. |
| 2092 | """ |
| 2093 | if _config._run_validators is False: |
| 2094 | return |
| 2095 | |
| 2096 | for a in fields(inst.__class__): |
| 2097 | v = a.validator |
| 2098 | if v is not None: |
| 2099 | v(inst, a, getattr(inst, a.name)) |
| 2100 | |
| 2101 | |
| 2102 | def _is_slot_cls(cls): |