Given a class such as
class MyClass:
text = "hello"
number = 123
Is there a way in python to inspect MyClass an determine that it has the two attributes text
and number
. I can not use something like inspect.getSource(object)
because the class I am to get it's attributes for are generate using SWIG (so they are hidden in .so :) ).
So I am really looking for something equivalant to Java's [Class.getDeclardFields][1]
Any help would be appreciated, otherwise I'll have to solve this problem with SWIG + JAVA instead of SWIG + Python.