They were added in Python 3.5 I think. There’s no way to enforce them at runtime, unfortunately, they’re essentially just “type hints” that can be read by tools like Pyre to point out type errors.
You can enforce them at runtime with decorators from third party libraries, for example enforce. It’s similar to how you can’t enforce them at “compile” time either; instead, you call mypy.
Does the FB post come with a link to somewhere else? It would be nice, out of principle, not to try to open an FB link in vain.
Most likely login nag and tracking cookies…
I know what you mean. The docs are at https://pyre-check.org/.
I didn’t know the language supported adding type annotation to functions… that’s neat!
They were added in Python 3.5 I think. There’s no way to enforce them at runtime, unfortunately, they’re essentially just “type hints” that can be read by tools like Pyre to point out type errors.
You can enforce them at runtime with decorators from third party libraries, for example enforce. It’s similar to how you can’t enforce them at “compile” time either; instead, you call mypy.