def canonicClassString(x):
 if isinstance(x, object):
  return repr(x.__class__).split("'")[1]
 else:
  return repr(x.__class__)

def canonicClassString ( x ) : if isinstance ( x , object ) : return repr ( x . __class__ ) . split ( "'" ) [ 1 ] else : return repr ( x . __class__ )
the __class__ attribute changed from old-style to new-style classes .