📜  python 获取类的属性 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:03.368000             🧑  作者: Mango

代码示例2
import inspect

class myclass:
  a = 5
  def method(b):
    return b

for i in inspect.getmembers(myclass):
  print(i)