import pickle, gtk, gobject, sys
from pprint import pprint

for key, val in filter(lambda keyval: isinstance(keyval[1], gobject.GEnum), gtk.__dict__.items()):
    if hasattr(val, '__dict__'):
            print key, 'has __dict__, value is %d, type is %s'%(val, type(val))
    else:
            print key, 'does *not* have __dict__, value is %d, type is %s'%(val, type(val))
    try:
            blah = pickle.dumps({key:val})
    except:
            print '\t%s: %s failed to DUMP'%(key, val)
    try:
            pickle.loads(blah)
    except:
            print '\t%s: %s failed to LOAD, exception is %s'%(key, val, sys.exc_info()[1])

