3 ms·
After taking a programming languages course I came away with the impression that Python is untyped. Type annotations are not required or enforced, and expressio
by intalentive 2y ago
After taking a programming languages course I came away with the impression that Python is untyped. Type annotations are not required or enforced, and expression types are not evaluated prior to execution. So here’s another vote for the academics.
- kstrauser 2y agoThe result of the expression is not compared to an annotation if there isn't one, but that result absolutely has a type of its own. And the objects inside an expression assuredly care about their types: >>> '1' + 1 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can only concatenate str (not "int") to str