找出深拷贝钩子里的 bug

来自 浅拷贝与深拷贝
Python 3.14 进阶 4分钟 找出 2处问题

找出这个生成的深拷贝钩子中两处与 memo 有关的错误。

Python
import copy

class Node:
    def __init__(self, name):
        self.name = name
        self.children = []

    def __deepcopy__(self, memo):
        clone = type(self)(self.name)
        clone.children = [copy.deepcopy(child) for child in self.children]
        return clone
在试验场中打开
报告错误