📝 Simplify intro to Python Types, all currently supported Python versions include type hints 🎉#2085
Conversation
Function annotation syntax was proposed in [pep 3107](https://www.python.org/dev/peps/pep-3107/) in 2006 and was a feature of Python 3.0. Type annotations were already a proposed usecase at this time. Mypy supports Python 3.2 and newer. A standard vocabulary for type hints (and the typing module itself) based on conventions used in Mypy and other sources was added in 3.5 with [pep 484](https://www.python.org/dev/peps/pep-0484/). The only thing new for type hints in 3.6 is _variable annotations_, which allows types to be specified outside of function signatures. [pep 526](https://www.python.org/dev/peps/pep-0526/)
Codecov Report
@@ Coverage Diff @@
## master #2085 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 239 239
Lines 7079 7079
=========================================
Hits 7079 7079 Continue to review full report at Codecov.
|
|
📝 Docs preview for commit 0f205e8 at: https://5f6b11a64e63eafd3e61ad2e--fastapi.netlify.app |
|
I think this proposal is technically correct but I find some drawbacks.
|
|
Is it possible to rephrase this in such a way that it is both technically correct and doesn't give people the wrong idea? (a possible option would be to omit details about when type annotations were introduced altogether) |
|
Considering 3.5 reached end of life this month, completely removing the version sounds the best. |
|
📝 Docs preview for commit a9589a0 at: https://5f6ce1c73b57e61ca550f17c--fastapi.netlify.app |
|
Awesome, thanks! It's so nice that type hints are now "mainstream" and standard in all the Python versions supported! 🎉 Thanks for your contribution! 🚀 🎉 And thanks @ArcLightSlavik for those points ✔️ 🔍 |
Function annotation syntax was proposed in pep 3107 in 2006 and was a feature of Python 3.0. Type annotations were already a proposed usecase at this time. Mypy supports Python 3.2 and newer. A standard vocabulary for type hints (and the typing module itself) based on conventions used in Mypy and other sources was added in 3.5 with pep 484.
The only thing new for type hints in 3.6 is variable annotations, which allows types to be specified outside of function signatures. pep 526