dir() without built-in methods
Do you just want to filter out the "special" methods, or actually know which methods are implemented in the instance itself, not inherited from a base (or both, as these are different questions, really)?
You can filter out the special methods with something reasonably simple like:
def vdir(obj):
return [x for x in dir(obj) if not x.startswith('__')]
>>> vdir(a)
['foo']