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

No great way to inherit from another Vlad #26

Open
di opened this issue Aug 12, 2016 · 0 comments
Open

No great way to inherit from another Vlad #26

di opened this issue Aug 12, 2016 · 0 comments

Comments

@di
Copy link
Owner

di commented Aug 12, 2016

For example, if we have:

class YourFirstValidator(Vlad):
    source = LocalFile('vampires.csv')
    validators = {
        'Column A': [
            UniqueValidator()
        ],
        'Column B': [
            SetValidator(['Vampire', 'Not A Vampire'])
        ]
    }

And we wanted to create a new class that slightly modifies the existing Vlad, we'd have to do:

class YourSecondValidator(YourFirstValidator):
    validators = YourFirstValidator.validators
    validators['Column C'] = SetValidator(['Real', 'Not Real'])

(this one's for you, @dmcclory)

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

No branches or pull requests

1 participant