def name_of(obj):
    """Return the name of *obj*.

    :param obj: any object

    .. note::
       This function will return ``obj.__qualname__`` if :pep:`3155` is
       supported in the runtime Python implementation; otherwise
       ``obj.__name__`` is returned.

    """
    return getattr(obj, '__qualname__', obj.__name__)
