doc:: 内置函数
getattr()
获取对象的属性值
语法:getattr(object, attribute, default)
class Person:
def __init__(self, name:str):
self.name = name
def get(self):
print(f"Hello {self.name}")
person = Person("immwind")
print(getattr(person, "name"))
get = getattr(person, "get")
get()