在 Python 3.9+ 中,我可以编写list_of_integers: list[int],但我看到高级开发人员使用旧语法(即使在 Python 3.9 和 3.10 脚本中):
list_of_integers: list[int]
from typing import List list_of_integers: List[int]
这对于向后兼容性和明确性来说是否优越?
python python-typing
python ×1
python-typing ×1