typing 是在 python 3.5 才有的模块
Python 类型提示:https://cloud.tencent.com/developer/article/1864619
https://cloud.tencent.com/developer/article/1866298
https://www.cnblogs.com/poloyy/p/15153883.html
https://cloud.tencent.com/developer/article/1866296
https://cloud.tencent.com/developer/article/1866297
https://cloud.tencent.com/developer/article/1866293
https://cloud.tencent.com/developer/article/1866294
联合类型
Unionint, str 表示既可以是 int,也可以是 str
vars: Union[int, str]
# 等价于
vars: [int or str]
vars: Union[int]
# 等价于
vars: int
Union[int] == int
最终 Unionint 返回的也是 int 类型
Union[int, str, int] == Union[int, str]
重复的类型参数会自动忽略掉
Union[int, str] == Union[str, int]
自动忽略类型参数顺序
Union[Union[int, str], float] == Union[int, str, float]
union 嵌套 union 会自动解包