Python 3 type check not works with use typing module?

后端 未结 5 1117
时光取名叫无心
时光取名叫无心 2021-01-13 11:19

Why does type checking not work in Python 3?

I have done the following code with type checks or hints:

import typing

def hello(message: str):
    pr         


        
5条回答
  •  旧巷少年郎
    2021-01-13 11:46

    What you want is a static typing, which is opposite to dynamic typing paradigm accepted by python.

    You may use mypy - a project which brings static typing to python.

提交回复
热议问题