3 ms·
I don't know if mypy allows you to mock the API but at least flow does for javascript. If a library is untyped you get a file with all the exported functions an
by kobalsky 6y ago
I don't know if mypy allows you to mock the API but at least flow does for javascript. If a library is untyped you get a file with all the exported functions and you can quickly set the types for the functions that you interface with. We have been using this for a couple of years and it's a godsend. There's a community project to share these external library definitions https://github.com/flow-typed/flow-typed https://github.com/flow-typed/flow-typed
- DonaldPShimoda 6y agoThat's a neat feature!
- icebraining 6y agoYou can do the same in mypy by generating a stub file: https://mypy.readthedocs.io/en/stable/stubs.html https://mypy.readthedocs.io/en/stable/stubs.html
- DonaldPShimoda 6y ago! I had no idea. Super cool — thanks for letting me know!