Closed
Description
Feature or enhancement
Proposal:
In the copy.deepcopy
method we can skip the initial memo check if the memo was just created. We can replace
if memo is None:
memo = {}
d = id(x)
y = memo.get(d, _nil)
if y is not _nil:
return y
with
d = id(x)
if memo is None:
memo = {}
else:
y = memo.get(d, _nil)
if y is not _nil:
return y
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Projects
Status
Done