def _iter_ns_str_reversed(namespace):
    """
        Take a namespace string, and yield successively smaller portions
        of it (ex foo::bar::baz::, foo::bar::, foo::). The last item yielded
        will always be an empty string
    """
    if namespace:
        parts = namespace.split('::')
        for i in range(len(parts) - 1, 0, -1):
            yield '::'.join(parts[:i]) + '::'
    yield ''
