Unlike Python s array, which implements __copy__
and __deepcopy__
so that the copy module can use it,
Python s list does not implement __copy__
and __deepcopy__
. (although there is a copy method)
Instead, the logic related to list copy is implemented in the copy function and deepcopy function of the copy module.
为什么有<代码>copy__和_deepcopy__
方法不同?