def typeStr(obj):
 typ = type(obj)
 if (typ == getattr(types, 'InstanceType', None)):
  return ('<instance of %s>' % obj.__class__.__name__)
 else:
  return str(typ)

def typeStr ( obj ) : typ = type ( obj ) if ( typ == getattr ( types , 'InstanceType' , None ) ) : return ( '<instance of %s>' % obj . __class__ . __name__ ) else : return str ( typ )
create a more useful type string by making <instance> types report their class .