def qualname(cls):
    """
    Similar to the Python 3.3+ __qualname__ attribute.
    >>> qualname(C)
    'C'
    >>> qualname(C.f)
    'C.f'
    >>> qualname(C.D)
    'C.D'
    >>> qualname(C.D.g)
    'C.D.g'
    """
    return '%s.%s' % (cls.__module__, cls.__name__)