Message228227
Oh, sorry, I missed the workarounds when I read the issue. So your issue is you want to use a lambda rather than a full function for the side effect and it looks ugly.
I agree that given the names 'side_effect' and 'return_value' you'd think return_value would take precedence. On the other hand, the API is what it is, and I'm not sure we can change it for backward compatibility reasons. Option 1 is definitely not on the table, and the problem with option 2 is that it is easy to imagine a side_effect that conditionally returns mock.DEFAULT. |
|
Date |
User |
Action |
Args |
2014-10-02 14:03:54 | r.david.murray | set | recipients:
+ r.david.murray, michael.foord, Dima.Tisnek |
2014-10-02 14:03:54 | r.david.murray | set | messageid: <1412258634.35.0.49984037295.issue22541@psf.upfronthosting.co.za> |
2014-10-02 14:03:54 | r.david.murray | link | issue22541 messages |
2014-10-02 14:03:54 | r.david.murray | create | |
|