def qualname(obj):
 if isinstance(obj, functools.partial):
  obj = obj.func
 if hasattr(obj, '__module__'):
  prefix = '{}.'.format(obj.__module__)
 else:
  prefix = ''
 if hasattr(obj, '__qualname__'):
  return '{}{}'.format(prefix, obj.__qualname__)
 elif hasattr(obj, '__name__'):
  return '{}{}'.format(prefix, obj.__name__)
 else:
  return repr(obj)

def qualname ( obj ) : if isinstance ( obj , functools . partial ) : obj = obj . func if hasattr ( obj , '__module__' ) : prefix = '{}.' . format ( obj . __module__ ) else : prefix = '' if hasattr ( obj , '__qualname__' ) : return '{}{}' . format ( prefix , obj . __qualname__ ) elif hasattr ( obj , '__name__' ) : return '{}{}' . format ( prefix , obj . __name__ ) else : return repr ( obj )
get the fully qualified name of an object .