主页
Python
Python vars() 函数
demo_ref_vars
运行 ❯
×
更改方向
保存代码
更改主题
class Person: name = "John" age = 36 country = "norway" x = vars(Person) print(x)
{'__module__': '__main__', 'name': 'John', 'age': 36, 'country': 'Norway', '__dict__': <attribute '__dict__' of 'Person' objects>, '__weakref__': <attribute '__weakref__' of 'Person' objects>, '__doc__': None}