在使用带注释字段定义类/模块时,如何像函数中那样获取注释?
class Test: def __init__(self): self.x : int t = Test()
现在我需要从 getattr(t,'x')
getattr(t,'x')
python type-annotation
python ×1
type-annotation ×1