On Wed, Mar 6, 2013 at 7:46 AM, Jeroen Demeyer <jdeme...@cage.ugent.be> wrote:
> On 2013-03-06 16:23, Timo Kluck wrote:
>> you can
>> suddenly mix all that piping with with dictionaries, or any
>> other things in which python is superior to bash.
> This would probably be the best argument.
>
>> Think readability
> So you think that
>   (echo 'print(factor(x^2 - 1))' | xargs[sage['-c']])()
> is more readable than
>   echo 'print(factor(x^2 - 1))' | xargs sage -c
>
>> That'll help against bugs of the type "foo does not
>> work when I have a space in my path".
> Quoting in bash can also prevent these problems.

Quoting is notoriously hard to get right because. And you still have
ugliness like

   if [ x"$var" = "xValue" ] ...

and

   python -c 'print "'"'"'"'

to pass a single quote.

>> Suppose that your first checkout fails (the branch exists, or you are in
>> the middle of a merge, or whatever). Now all your tempary changes are in
>> you master branch. I should have checked exit codes, but who does? With
>> plumbum, the failing checkout will give you an exception right away.
> With "set -e" in bash, this also holds for shell scripts.

But there's no error recovery then.

There are several python-as-a-shell options out there, it would make
sense to look at several and pick one.

- Robert

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to