7

I need to manipulate a large list of objects. Now, I need to invoke copy.deepcopy and it raises a RunTimeError: maximum recursion depth exceeded (Its OK when I try it with a smaller list.). My question is: Is there any other way to get the feature of copy.deepcopy which does not have this problem? Regards.

4

1 回答 1

8

你可能有一个非常深的结构。您应该增加递归限制:

 sys.setrecursionlimit(10000)  # default is 1000 in my installation
于 2013-09-09T11:56:26.890 回答