3 ms·
I haven't used optional typing in python. However, the problem I see with optional typing is that while I may choose to use it my team mates might not. Even m
by nightski 9y ago
I haven't used optional typing in python. However, the problem I see with optional typing is that while I may choose to use it my team mates might not. Even more importantly, the 3rd party dependencies I use probably don't. So the amount of code that actually uses the types would be very limiting. Saying the choice is entirely up to you personally is a misnomer.
- gipp 9y agoStrict use of type annotations has to be a team decision, yes. Checking for them can be integrated into a CI build, though. The typing spec provides for supplementary "stub files" that can be provided for third-party dependencies without their own annotations. The typeshed project provides these for a fair and quickly increasing number of common dependencies, and is plugged into pycharm and mypy by default: https://github.com/python/typeshed https://github.com/python/typeshed
- yawaramin 9y agoI think GP meant 'you' as in 'your team'. Anyway, Python has a type repository for popular libraries, just like TypeScript does. And mypy can still typecheck your code even without type annotations.