mirror of
https://github.com/python/cpython.git
synced 2025-09-12 03:37:09 +00:00
gh-109868: Skip deepcopy memo check for empty memo (GH-109869)
This commit is contained in:
parent
7dc2c5093e
commit
05079d93e4
1 changed files with 5 additions and 5 deletions
|
@ -121,10 +121,10 @@ def deepcopy(x, memo=None, _nil=[]):
|
||||||
See the module's __doc__ string for more info.
|
See the module's __doc__ string for more info.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
d = id(x)
|
||||||
if memo is None:
|
if memo is None:
|
||||||
memo = {}
|
memo = {}
|
||||||
|
else:
|
||||||
d = id(x)
|
|
||||||
y = memo.get(d, _nil)
|
y = memo.get(d, _nil)
|
||||||
if y is not _nil:
|
if y is not _nil:
|
||||||
return y
|
return y
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue