by andrewingram · 5y ago · 0 comments
What I've really been looking for something that I can just use to check a data structure i'm passing in to a function call is valid. One use case is related to state machines, where I'm providing some data along with a transition name, and want to make sure the combination of transition + data is valid.
It works great for a python stack and you can generate some clean looking code if you have a reusable data class package
Also, Attrs and Pydantic both support arbitrary additional validation on fields.