import pprint, types
_pprint = pprint
_types = types
del pprint
del types

def _inst_to_dict(inst):
    dict = vars(inst).copy()
    for (key, value) in dict.items():
        if type(value) is _types.InstanceType:
            dict[key] = _inst_to_dict(value)
    return dict

def pprint(object):
    if type(object) is _types.InstanceType:
        object = _inst_to_dict(object)
    _pprint.pprint(object)
        
