Jim Jeon <jimjeon...@gmail.com> added the comment:

Thank you all for the kind answers.
I didn't know copying could cause so many problems.

@veky
Thank you for the example.
But it seems that the example will actually raise and I think it should.
I am talking f.assert_called_with(b) when `b` has same values of `a` before it 
is mutated. I thought the function's purpose is to check values of the exact 
moment the function is called.

@xtreak
Thanks for the related issue. I didn't consider `identity comparison` 
situations. Definitely that could cause problems.

@mariocj89
> copy does not fully capture "the value of the object when it was passed" for 
> custom types.
Thank you for the kind answer, it was really helpful to me. Now I understand 
why copying is so dangerous.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38346>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to