2 ms·
Exactly right, great example. And furthermore: >>> foo: int = 'hello' >>> type(foo) <class 'str'> Python's type annotations are annotations. Types
by bscphil 5y ago
Exactly right, great example. And furthermore:
>>> foo: int = 'hello'
>>> type(foo)
<class 'str'>
Python's type annotations are annotations. Types are being enforced at runtime, it's just that some are thinking that annotations have some effect on the interpreter, when they do not.