4 ms·
Not if you use pypy and mypy.
by j88439h84 8y ago
Not if you use pypy and mypy.
- aldanor 8y agoThere's also things like numba - basically a Python decorator that lazily JIT-compiles Python functions to LLVM, and supports numpy. For scientific work, it's quite often hard to beat (and sometimes somehow beats a raw c/c++ implementation of the same thing).
- robrtsql 8y agoMy issue with mypy is that I would like it to verify that I'm passing the right types into functions from my dependencies. For example, I do a lot of scripting with Python and boto3 to interact with AWS, and my scripts often fail the first time because I misread the field name or structure of a JSON object that goes into or comes from the API. It makes me wish I was using Java or Go, because at least then the compiler would have told me it was wrong. I'm not sure if a solution to this exists yet. It seems like it's up to the dependency to adopt mypy as well?
- j88439h84 8y agoYeah I think so. There is monkeytype which can infer the types from test runs and insert them into source, so its quite easy to add annotations.