Skip to content

Provide a builtin validator that takes a boolean function. #832

Open
@tomprince

Description

@tomprince

Currently, validators are required to raise an exception, if the value isn't appropriate. If I currently have a function for checking the property, but returns a boolean, instead of raising, to use it as a validator, I have to write a wrapper that converts the return to an exception. It would be nice if attrs provided such a wrapper itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions