3 ms·
What would be neat is if you could take a Python program and run type inference on the program and it would output a type annotated version of the code.
by zitterbewegung 7y ago
What would be neat is if you could take a Python program and run type inference on the program and it would output a type annotated version of the code.
- duckerude 7y agoI don't have experience with it, but pytype can do that: https://github.com/google/pytype https://github.com/google/pytype After typechecking it leaves provisional stubs in .pytype/pyi/, and it has a tool to merge them into the original code. mypy has stubgen: https://mypy.readthedocs.io/en/latest/stubgen.html https://mypy.readthedocs.io/en/latest/stubgen.html As far as I know it's less powerful since mypy isn't really built for unannotated code and pytype is.