Thomas Kluyver added the comment:

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).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23342>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to