[Python][迭代器和生成器]委托迭代委托迭代的概念和意图实验代码实验结果
class Node: def __init__(self,value): self._value = value self._children = [] def __repr__(self): return 'Node({!r}) '.format(self._value) def add_child(self, node): self._children.append(node) def __iter_