Update docstrings for walk_children, walk_parents.

master
voussoir 2020-03-19 19:03:47 -07:00
parent 0a8a754cbc
commit 13c3a1c0e9
1 changed files with 4 additions and 1 deletions

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)