What are type hints in Python 3.5?

后端 未结 5 1104
死守一世寂寞
死守一世寂寞 2020-11-21 11:01

One of the most talked about features in Python 3.5 is type hints.

An example of type hints is mentioned in this article and this o

5条回答
  •  无人及你
    2020-11-21 11:58

    Type hint are a recent addition to a dynamic language where for decades folks swore naming conventions as simple as Hungarian (object label with first letter b = boolian, c = character, d = dictionary, i = integer, l = list, n = numeric, s = string, t= tuple) were not needed, too cumbersome, but now have decided that, oh wait ... it is way too much trouble to use the language (type()) to recognize objects, and our fancy IDEs need help doing anything that complicated, and that dynamically assigned object values make them completely useless anyhow, whereas a simple naming convention could have resolved all of it, for any developer, at a mere glance.

提交回复
热议问题