5 ms·
https://github.com/keleshev/schema https://github.com/keleshev/schema a library for validating python data structures by schema definitions, gave me a wow momen
by MichaelMoser123 5y ago
https://github.com/keleshev/schema https://github.com/keleshev/schema a library for validating python data structures by schema definitions, gave me a wow moment. (i have a slightly less original one here: https://github.com/MoserMichael/kwchecker https://github.com/MoserMichael/kwchecker )
- ehsankia 5y agoLove the idea of Schema, but not a fan of that syntax, doesn't seem Pythonic to me, seems more like something you'd see out of Javascript word. Like looking at that very first example, I have no clue what "len" means in that context. Is it implicitly checking that it's not an empty string? Then on the next line, how come `int` has `Use()` around it, but on the previous line `str` didn't? I guess that int is being used as a converter, line on the next line with str.lower, but the str was being used as a type check? Not a fan of that API.