What is the purpose of type hints in Python?
- A They enforce types at runtime
- B They document intent and enable static checkers such as mypy to catch errors before execution
- C They speed up execution
- D They are required in Python 3
Answer
They document intent and enable static checkers such as mypy to catch errors before execution
Python does not enforce annotations at runtime. Their value comes from static analysis and improved editor support.





