def __iter__(self):
    'Only iterate over all components from the current pointer.'
    element = self
    while element.HasField('pathtype'):
        (yield element)
        if element.HasField('nested_path'):
            element = element.nested_path
        else:
            break
Only iterate over all components from the current pointer.
def __iter__(self):
    
    element = self
    while element.HasField('pathtype'):
        (yield element)
        if element.HasField('nested_path'):
            element = element.nested_path
        else:
            break