You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the deepcopy() implementation needs to make a deep copy of a component, it should call the deepcopy() function with the component as first argument and the memo dictionary as second argument.
So:
It should be nice that the wording "first", "second", etc, match. It was a little bit confusing for me.
At least as the way I do understand it, memodict doesn't seem to work as documented:
>>> memodict = {}
>>> data = {'a': [1,2,3]}
>>> from copy import deepcopy
>>> deepcopy(data, memodict=memodict)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: deepcopy() got an unexpected keyword argument 'memodict'
Thanks.
The text was updated successfully, but these errors were encountered:
In section "Copying":
http://www.rafekettler.com/magicmethods.html#copying
Says:
Official documentation for Python 3 says:
https://docs.python.org/2/library/copy.html#copy.deepcopy
So:
Thanks.
The text was updated successfully, but these errors were encountered: