Skip to content

Support a dict-like variant to define validation functions #40

@smarie

Description

@smarie

this could be cool

validate('x', x, custom={'x should be finite': (isfinite, NotFinite),
                                 'x should be even': is_even,
                                 'x should be strictly positive': (i > 0)})

or

validate('x', x, custom={isfinite: ('x should be finite', NotFinite),
                                 is_even: 'x should be even',
                                 (i > 0): 'x should be strictly positive'})

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions