[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: Greg Stein <gstein_at_lyra.org>
Date: 2003-02-22 11:23:33 CET

On Sat, Feb 22, 2003 at 12:58:47AM -0600, B. W. Fitzpatrick wrote:
>
> cmpilato@collab.net writes:
> > Benjamin Pflugmann <benjamin-svn-dev@pflugmann.de> writes:
>
> > > 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.

Oh, yah, trust me... I think it is awful, too. In my own code, I wouldn't
use either trick. i'd just write:

  if ex.code:
    print 'FAIL',
  else:
    print 'PASS',

I was just having a bit of fun. But seriously, that and/or "trick" is a
somewhat standard idiom for a Python ternary operator. Frickin' ugly, but
there ya go.

[ altho it is limited as a ternary operator. if you have:
    X and Y or Z
  and Y is a "false" value, then the result is Z. Brane's form will always
  return Y, whether it represents a true or a false value. In this concrete
  case, Y was a "true" constant value, so it was safe. ]

> > Whoa. Deja vu all over [Greg] again. Gstein is just too freakin'
> > saucy of a hacker. :-)

hehe... I *did* say it was for Python Fu Masters. That is another way of
saying it was for people who prefer Perl's opaqueness. :-)

> Well, I think Greg's suggestion is more python-flavored, and thus I
> prefer it, but I always say if it ain't broke, don't paint it a
> different color. Or something like that. Off you go then.

heh...

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Feb 22 11:19:23 2003

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