Skip to content

Commit

Permalink
pythongh-109868: Skip deepcopy memo check for empty memo (pythonGH-10…
Browse files Browse the repository at this point in the history
  • Loading branch information
eendebakpt authored Sep 29, 2023
1 parent 7dc2c50 commit 05079d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Lib/copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ def deepcopy(x, memo=None, _nil=[]):
See the module's __doc__ string for more info.
"""

d = id(x)
if memo is None:
memo = {}

d = id(x)
y = memo.get(d, _nil)
if y is not _nil:
return y
else:
y = memo.get(d, _nil)
if y is not _nil:
return y

cls = type(x)

Expand Down

0 comments on commit 05079d9

Please sign in to comment.