42 ms·
I find it best to see type hinting as "living documentation". Yeah, you can ignore it, it is Python afterall, but if you want the IDE/tools to have better more
by sirsinsalot 5y ago
I find it best to see type hinting as "living documentation". Yeah, you can ignore it, it is Python afterall, but if you want the IDE/tools to have better more helpful hints ... use machine readable hint documentation.
I'd argue if your functions are full of type-assert like guards, _then_ use another language!
- bb88 5y agoI just saw someone on Twitter post a "IntegerType" class which did exactly this, including capturing the sign -- because he couldn't trust int().