3 ms·
Hot take: If you think for a moment about the feature name, "type hints", many (all) of the objections the author has become clear. It is not called "static ty
by linsomniac 5y ago
Hot take: If you think for a moment about the feature name, "type hints", many (all) of the objections the author has become clear.
It is not called "static typing". It's called "type hinting". Based largely on the name, I wouldn't expect it to error at runtime if you tell me 'hello' is an int. That's just a type hint. I WOULD expect a static analysis to flag is, and mypy indeed does.
- reikonomusha 5y agoAren't they called "annotations" by PEP 484? Annotating certainly sounds stronger than hinting, but one must dive in and read the PEP to see they in fact do nothing except stash away metadata in a dunder attribute.