Python 3.5 type hinting does not result in an error

前端 未结 2 1558
无人共我
无人共我 2020-12-20 16:16

One of the new features in python 3.5 is type hinting inspired from this project.

typing: PEP 484 – Type Hints.

I want to test

2条回答
  •  星月不相逢
    2020-12-20 17:10

    See the fifth paragraph of the abstract in the PEP you link to:

    While these annotations are available at runtime through the usual __annotations__ attribute, no type checking happens at runtime . Instead, the proposal assumes the existence of a separate off-line type checker which users can run over their source code voluntarily

提交回复
热议问题