Pre*_*sch 11 python python-typing
在 Python 3.9+ 中,我可以编写list_of_integers: list[int],但我看到高级开发人员使用旧语法(即使在 Python 3.9 和 3.10 脚本中):
from typing import List
list_of_integers: List[int]
Run Code Online (Sandbox Code Playgroud)
这对于向后兼容性和明确性来说是否优越?
| 归档时间: |
|
| 查看次数: |
2992 次 |
| 最近记录: |