smart_open
smart_open copied to clipboard
Add type annotations to smart_open
This is still a work in progress. I'm playing around with the idea to see if it's worth it.
Check out PEP 585: starting with python3.7, annotations become infinitely more readable.
May be worth the wait, until we drop py3.6?
Will that much change? From looking at that PEP, we'll go from using e.g. Dict[str, int] to dict[str, int] (and get rid of the from typing import (...).
To me – yes. I don't have anything against annotations but rarely use them, because I find they obfuscate more than clarify. Cons>pros.
A nicer, better integrated annotation syntax could tip the scales. Just a nice-to-have feature either way, nothing critical.