Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找类似的东西dir(),但想过滤掉在超类/es中定义的非实例方法和属性。
dir()
对于 python 2.x:
[name for name, method in Class.__dict__.iteritems() if callable(method)]
对于 python 3.x:
[name for name, method in Class.__dict__.items() if hasattr(method,'__call__')]