[issue32632] Mock does not create deepcopy of mutable args

Michael Foord report at bugs.python.org
Tue Jan 23 04:31:13 EST 2018


Michael Foord <michael at voidspace.org.uk> added the comment:

There are several disadvantages to doing deepcopy:

* identity checks now fail
* deep copying is slow
* deep copying doesn't work on arbitrary objects

So deep copying by default isn't a good idea. This particular case is mentioned in the docs, with an example of a deep-copying mock if you need one.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32632>
_______________________________________


More information about the Python-bugs-list mailing list