jTaylo99 / kolumnextractor

A data extractor designed around building your requirements and easily extracting and verifying your data.
4 stars 8 forks source link

What if validators were closures? #42

Open geoffleyland opened 1 year ago

geoffleyland commented 1 year ago

Rather than using a validate method in a validator, it might be better to use __call__ - you can make objects callable, but you can't make functions and closures into objects with methods other than the function that they are.

Then you can write a validator as lamba x: assert(x > 0 && x < 100) or something like that