R. David Murray added the comment: 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. ---------- nosy: +michael.foord versions: -Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22541> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com