commit | 6afff6139a445de62a9cb45dadf1b9ca905f2540 | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Mon Jun 17 17:10:11 1996 +0000 |
committer | Guido van Rossum <guido@python.org> | Mon Jun 17 17:10:11 1996 +0000 |
tree | 1d6b5786e13ee32647169b4892bf5c309ad4f915 | |
parent | 7c46a920ae214c43b18a0c064c7bf80492a434c9 [diff] |
Memoize _deepcopy_tuple() -- maybe this helps Tommy's problem.
diff --git a/Lib/copy.py b/Lib/copy.py index a48e8c8..15e0e40 100644 --- a/Lib/copy.py +++ b/Lib/copy.py
@@ -182,8 +182,12 @@ pass for i in range(len(x)): if x[i] is not y[i]: - return tuple(y) - return x + y = tuple(y) + break + else: + y = x + memo[d] = y + return y d[types.TupleType] = _deepcopy_tuple def _deepcopy_dict(x, memo):