5 ms·
The docs at python.org refer to them as “type hints” ️ https://docs.python.org/3/library/typing.html https://docs.python.org/3/library/typing.html
by ieie92ndjrj 7y ago
The docs at python.org refer to them as “type hints” ️
https://docs.python.org/3/library/typing.html https://docs.python.org/3/library/typing.html
- uranusjr 7y ago`typing` is the module that uses annotations as type hints. Parent is correct; Python documentation calls the syntax annotations.
- ieie92ndjrj 7y agoSo Python docs refer to both depending on the context.
- ehsankia 7y agoAs mentioned in the other comment, this is just a library used to give type hints as annotations. The feature itself is called annotations, this is one specific use-case. The reason this library exists in stdlib is so that all the different type hint libraries can interoperate. Otherwise if they each brought their own typing, you couldn't switch between different static analysis libraries.