myfunc is the MyClass attribute. How it was found at startup:
myinstance = MyClass() myinstance.myfunc()
He searches for the myinstance attribute named myfunc , does not find it, sees that myinstance is an instance of MyClass and looks for it there.
Thus, a complete list of attributes for MyClass :
>>> dir(MyClass) ['__doc__', '__module__', 'a', 'b', 'myfunc']
(Note that I use dir as a quick and easy way to list class members: it should be used only in search mode, not in production code)
If you need only certain attributes, you will need to filter this list using some criteria, because __doc__ , __module__ and myfunc are not special, they are attributes just like a and b .
I have never used the validation module referenced by Matt and Borealid, but from the short link it looks like it has tests to help you do this, but you need to write your own predicate function, since what you want seems to be this approximately those attributes that do not pass the isroutine test and do not begin and end with two underscores.
Also note: using class MyClass(): in Python 2.7, you are using completely outdated old-style classes. If you are not doing this specifically for compatibility with extremely old libraries, you should instead define your class as class MyClass(object): There are no "old style" classes in Python 3, and this is the default behavior. However, using the newstyle classes will give you a lot more automatically defined attributes:
>>> class MyClass(object): a = "12" b = "34" def myfunc(self): return self.a >>> dir(MyClass) ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'a', 'b', 'myfunc']