Message235133
Yep, they are pretty much equivalent to those, except:
- check_call has a 'return 0' if it succeeds
- add '.stdout' to the end of the expression for check_output
I'll work on documenting the trio in those terms.
If people want, some/all of the trio could also be implemented on top of run(). check_output() would be the most likely candidate for this, since I copied that code to create run(). I'd probably leave call and check_call as separate implementations to avoid subtle bugs, though.
Sharing inheritance between CalledProcessError and CompletedProcess: That would mean that either CompletedProcess is an exception class, even though it's not used as such, or CalledProcessError uses multiple inheritance. I think duplicating a few attributes is preferable to having to think about multiple inheritance, especially since the names aren't all the same (cmd vs args, output vs stdout). |
|
Date |
User |
Action |
Args |
2015-01-31 21:57:24 | takluyver | set | recipients:
+ takluyver, barry, gregory.p.smith, r.david.murray, ethan.furman, martin.panter |
2015-01-31 21:57:24 | takluyver | set | messageid: <1422741444.05.0.487376025058.issue23342@psf.upfronthosting.co.za> |
2015-01-31 21:57:24 | takluyver | link | issue23342 messages |
2015-01-31 21:57:23 | takluyver | create | |
|