Is it, or could it be, possible to have optional type conversion using the convert argument, with the same logic as validation?
Something like:
@attr.s
class Thing(object):
x = attr.ib(default=None, convert=optional(float), validator=optional(validate_x))
Apologies if it's already supported; I just don't see how in the docs.
Is it, or could it be, possible to have optional type conversion using the
convertargument, with the same logic as validation?Something like:
Apologies if it's already supported; I just don't see how in the docs.