from typing import Callable


def callable_name(func: Callable) -> str:
    """Return the qualified name (e.g. package.module.func) for the given callable."""
    if func.__module__ == 'builtins':
        return func.__name__
    else:
        return '{}.{}'.format(func.__module__, func.__qualname__)