[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 5005 - trunk/subversion/tests/clients/cmdline/svntest

From: Benjamin Pflugmann <benjamin-svn-dev_at_pflugmann.de>
Date: 2003-02-22 06:21:49 CET

On Fri 2003-02-21 at 20:52:59 -0800, Greg Stein wrote:
> On Sat, Feb 22, 2003 at 05:29:40AM +0100, Branko Cibej wrote:
> > Greg Stein wrote:
> >
> > >Yikes. If some code does sys.exit(1), then you're transforming that into a
> > >sys.exit(0). Not good.
> > >
> > I took your suggestion and massaged it into r5014. What do you think?
>
> This line:
>
> + print ('PASS: ', 'FAIL: ')[ex.code != 0],
>
> eek! :-)
>
> Actually, there has been some discussion of adding a ternary operator to
> Python. oy...
>
> Note the Python Fu Master way to write the above:
>
> print ex.code and 'FAIL' or 'PASS'

Hmmmm. Style issues aside, as someone who did never program Python,
but only looked at it, I had no problem to parse the Brane's array
trick, but I wouldn't have known what your line does.

Or more precisly: I was able to guess what it is meant to do (the
strings FAIL and PASS in a print statement are quite telling), but
would expect a flawed output. In other words: either it has a bug
(unprobable) or it expects too much Python knowledge from the
uninitiated. ;)

Real Fu Masters write code that is tricky and easy to read. ;)

    Benjamin, with a broad grin.

  • application/pgp-signature attachment: stored
Received on Sat Feb 22 06:22:32 2003

This is an archived mail posted to the Subversion Dev mailing list.