python 声明变量但不赋值 的语法

LIST: list

使用之前需要赋值,否则报错.
实际使用场景,见pandas\core\frame.py 9233行:
index: "Index" = properties.AxisProperty(
axis=1, doc="The index (row labels) of the DataFrame."
) # 声明index,类型为 properties.AxisProperty类


"Index" 的含义暂时不清楚
posted @ 2020-08-18 18:00  ZRHW菜鸟  阅读(4335)  评论(0编辑  收藏  举报