def descendents(self, type=None):
    'Return hierarchy of objects in set'
    for member in self.members(type=type):
        (yield member)
        try:
            for child in member.descendents(type=type):
                (yield child)
        except AttributeError:
            continue
Return hierarchy of objects in set
def descendents(self, type=None):
    
    for member in self.members(type=type):
        (yield member)
        try:
            for child in member.descendents(type=type):
                (yield child)
        except AttributeError:
            continue