Kaydet (Commit) 6afff613 authored tarafından Guido van Rossum's avatar Guido van Rossum

Memoize _deepcopy_tuple() -- maybe this helps Tommy's problem.

üst 7c46a920
...@@ -182,8 +182,12 @@ def _deepcopy_tuple(x, memo): ...@@ -182,8 +182,12 @@ def _deepcopy_tuple(x, memo):
pass pass
for i in range(len(x)): for i in range(len(x)):
if x[i] is not y[i]: if x[i] is not y[i]:
return tuple(y) y = tuple(y)
return x break
else:
y = x
memo[d] = y
return y
d[types.TupleType] = _deepcopy_tuple d[types.TupleType] = _deepcopy_tuple
def _deepcopy_dict(x, memo): def _deepcopy_dict(x, memo):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment