Update docstrings for walk_children, walk_parents.

This commit is contained in:
voussoir 2020-03-19 19:03:47 -07:00
parent 0a8a754cbc
commit 13c3a1c0e9

View file

@ -199,13 +199,16 @@ class GroupableMixin:
self.photodb._cached_frozen_children = None
def walk_children(self):
'''
Yield self and all descendants.
'''
yield self
for child in self.get_children():
yield from child.walk_children()
def walk_parents(self):
'''
Yield all ancestors in no particular order.
Yield all ancestors, but not self, in no particular order.
'''
parents = self.get_parents()
seen = set(parents)