top | item 32453079

(no title)

Reubensson | 3 years ago

it doesnt enforce the types in any way

discuss

order

joshuamorton|3 years ago

Neither does typescript. All the types are removed at runtime, it's up to you to ensure that your build process and tooling correctly validates the types. The same is true for python, and the ecosystem has really great tools for doing this.

isoprophlex|3 years ago

You can run, for example, pre-commit checks such as mypy to enforce some semblance of sanity.

kortex|3 years ago

Use pydandic for serde/IO validation, and mypy --strict. And minimize cheating e.g. Any. I think you'll find it extremely stable and a totally different beast than usual python.

LtWorf|3 years ago

I wrote typedload before pydantic was a thing. It's faster and actually works well with mypy and python's type system.

Pydantic requires inheritance and requires a modified mypy because it uses types its own way rather than the python way.

Oh, typedload is faster than pydantic, despite being pure python instead of an .so file.