-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command logic API #7
Comments
I'm going to make two silly suggestions:
run('echo', 'header') & run('cat', 'file')
# also
from operator import and_
and_(run('echo', 'header'), run('cat', 'file'))
run('echo', 'header') and run('echo', 'header') |
@rockymeza thank you for your suggestion. This issue has been brought up in another thread, and here's my answer. |
Oh and BTW, |
class ReturnValue(object):
def __init__(self, code, output):
self.code = code
# ...
def __bool__(self):
return self.code == 0 |
let me redo my example code since I read the source: class Subprocess(object):
# ...
def __bool__(self):
self.wait()
return self.returncode == 0 |
The point of and isn't for short-circuit evaluation, but to compose a new On Wed, Jul 15, 2015 at 11:09 PM, Rocky Meza [email protected]
|
oh ok, that's fair -rocky On Fri, Jul 17, 2015 at 12:19 AM, Gavin Wahl [email protected]
|
I would like an API like this:
The text was updated successfully, but these errors were encountered: