Fully qualified name for 'function' objects in Python 3.

def _fullqualname_function_py3(obj):
    """Fully qualified name for 'function' objects in Python 3.
    """

    if hasattr(obj, "__wrapped__"):
        # Required for decorator.__version__ <= 4.0.0.
        qualname = obj.__wrapped__.__qualname__
    else:
        qualname = obj.__qualname__

    return obj.__module__ + '.' + qualname