4 ms·
> Most modern dynamic languages have strong types. In Python you will get a TypeError if you try to add a string and an int or use > on a tuple and a dict. >>>
by fnord123 9y ago
> Most modern dynamic languages have strong types. In Python you will get a TypeError if you try to add a string and an int or use > on a tuple and a dict.
>>> (1,2) > {1: 2}
True
>And dynamic languages excel at that because they make complex declarative schema descriptions easy while powerful.
Marshmallow looks like it works the same way as existing systems in statically types languages. e.g. Serde in Rust:
https://serde.rs/ https://serde.rs/
This validates at compile time.
- nooorofe 9y agoIn [60]: (1,2) > {1: 2} --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-60-f9d83a4c8f73> in <module>() ----> 1 (1,2) > {1: 2} TypeError: '>' not supported between instances of 'tuple' and 'dict'
- nicwolff 9y agoHe means Python 3.
- sametmax 9y agoI said "modern". Python 2 is not modern. Python 3 is. And the keyword in my schema validation sentence is "easy". I love rust, but a low level language cannot be compared in productivity to a high level language for this stuff. They are much, much easier. That's the whole purpose. You trade easiness for rigor.