Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add Equals validator #31

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

xsleonard commented Apr 20, 2013

This validator is somewhat trivial but it is helpful in unit tests

Contributor

xsleonard commented Apr 20, 2013

Nevermind, I see that it interprets literals in the schema.

@xsleonard xsleonard closed this Apr 20, 2013

@xsleonard xsleonard deleted the xsleonard:patch-1 branch Apr 20, 2013

Contributor

aaronharnly commented Feb 10, 2014

This validator would in fact be useful for a restricted list of non-literal values, e.g. enum-style objects.

Contributor

aaronharnly commented Feb 10, 2014

Example use case (extended to take a list of values):

Color = namedtuple('Color', ['name'])
rgb = Schema(Equals(Color("red"), Color("green"), Color("blue"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment