def possible_qualnames(cls):
    """
    Iterator over possible qualified names for class.
    """
    for subclass in cls.mro()[:-1]:
        path = subclass.__module__
        name = subclass.__qualname__
        while path:
            value = '%s.%s' % (path, name)
            yield value
            path, _, _ = path.rpartition('.')
