from typing import List, Tuple, Dict
names: List[str] = ['lily', 'tom']
version: Tuple[int, int, int] = (6, 6, 6)
operations: Dict[str, bool] = {'sad': False, 'happy': True}
安装 mypy 库运行脚本,会强制按类型检测,不符合类型注解要求的会报错:
# 安装 pip install mypy -U # 运行脚本 mypy program.py



