Message353894
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. |
|
Date |
User |
Action |
Args |
2019-10-04 02:02:01 | Jim Jeon | set | recipients:
+ Jim Jeon, cjw296, michael.foord, veky, lisroach, mariocj89, xtreak |
2019-10-04 02:02:00 | Jim Jeon | set | messageid: <1570154520.98.0.545459767686.issue38346@roundup.psfhosted.org> |
2019-10-04 02:02:00 | Jim Jeon | link | issue38346 messages |
2019-10-04 02:02:00 | Jim Jeon | create | |
|