Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Classy and SubClassy validators #1

Closed
wants to merge 4 commits into from
Closed

Conversation

ryansb
Copy link

@ryansb ryansb commented Jan 15, 2014

No description provided.

```
from validator import Classy, validate
rules = {"foo": [Classy(bool)]}
passes = {"foo": True}
fails = {"foo": 42}
print validate(rules, passes)
print validate(rules, fails)
```
```
from validator import SubClassy, validate
class lol(object): pass
class rotflol(lol): pass

rules = {"foo": [SubClassy(lol)]}
passes = {"foo": rotflol()}
fails = {"foo": 42}
print validate(rules, passes) # will pass
print validate(rules, fails) # will fail
```
@mansam
Copy link
Owner

mansam commented Jan 16, 2014

Hey Ryan, I've implemented Classy and rather than merging the pull, I'll reimplement Subclassy based on your work in order to bring it in line with the conventions used for everything else. Thanks!

@mansam
Copy link
Owner

mansam commented Jan 21, 2014

These changes have been brought in as part of the most recent release. Thanks!

@mansam mansam closed this Jan 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants