def children(self, return_key=False):
"""Iterate over the children of this container.
Args:
return_key (bool): Set to :const:`True` to
indicate that the return type should be a
2-tuple consisting of the child storage key
and the child object. By default, only the
child objects are returned.
Returns:
iterator of objects or (key,object) tuples
"""
if return_key:
return enumerate(self._data)
else:
return self._data.__iter__()
#
# Define the Sequence abstract methods
#
评论列表
文章目录