Message247371
Some great points raised here.
Yes, we'd need .calls and .returnvalue and so on all made accessible via another route, and that would be a less direct spelling.
e.g. a_mock.returnvalue = 3
->
# function
set_returnvalue(a_mock, 3)
or
# separate object to get at the mock housekeeping vs the mocked interface
mocki(a_mock).returnvalue = 3
etc.
None of which make me want to say 'wow thats a great api'.
I wouldn't want to advocate for a patch for this unless:
- it would feel as convenient to use as the current API does
- it would be possible to be both forward and backwards compatible with the existing API indefinitely: There are lots of users of mock, and offering a [presumably] improved API is not worth turning all that code into an instant sea-anchor: if we're going to change this, we need to do so in a -very- graceful fashion, because unlike e.g. the mock_open things that only affect some users of mock, this would (if done poorly) break every user ever.
For clarity, I have no plans to write such a patch at this time, though if someone did come up with a proof of concept I'd happily review it, and dig up Michael to get his thoughts *if and only if* it met the two constraints above.
I'm not sure of the right bug tracker state to say 'this is a maybe, maintainer isn't enthused about it'. |
|
Date |
User |
Action |
Args |
2015-07-25 18:59:33 | rbcollins | set | recipients:
+ rbcollins, brett.cannon, carljm, michael.foord, poke, bignose, erik.bray, berker.peksag, kushal.das, ztane, fov, kevinbenton |
2015-07-25 18:59:33 | rbcollins | set | messageid: <1437850773.34.0.849874892321.issue24651@psf.upfronthosting.co.za> |
2015-07-25 18:59:33 | rbcollins | link | issue24651 messages |
2015-07-25 18:59:32 | rbcollins | create | |
|