smart_open icon indicating copy to clipboard operation
smart_open copied to clipboard

Add type annotations to smart_open

Open mpenkov opened this issue 5 years ago • 3 comments
trafficstars

This is still a work in progress. I'm playing around with the idea to see if it's worth it.

mpenkov avatar Oct 03 '20 14:10 mpenkov

Check out PEP 585: starting with python3.7, annotations become infinitely more readable.

May be worth the wait, until we drop py3.6?

piskvorky avatar Oct 06 '20 09:10 piskvorky

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 (...).

mpenkov avatar Oct 06 '20 09:10 mpenkov

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.

piskvorky avatar Oct 06 '20 12:10 piskvorky