3 ms·
This idea doesn't apply so cleanly in Python. The meaning of this: if x=$(foo); then ... fi is that the stdout of running `foo` replaces the conte
by matvore 5y ago
This idea doesn't apply so cleanly in Python. The meaning of this:
if x=$(foo); then
...
fi
is that the stdout of running `foo` replaces the contents of $x and the `if` evaluates the exit code of `foo`. Python doesn't see stdout as some kind of first-class language construct. I also don't think this could ever work on Windows if you expect `foo` to be a simple function that has access to the interpreter state.