[PATCH 0/4] Speed improvement in fetch/clone
Martin Pool
mbp at sourcefrog.net
Fri Jan 20 02:03:11 GMT 2006
On 19 Jan 2006, Jan Hudec <bulb at ucw.cz> wrote:
> On Thu, Jan 19, 2006 at 01:56:32 -0800, Robey Pointer wrote:
> >
> > On 18 Jan 2006, at 13:52, Goffredo Baroncelli wrote:
> >
> > >+ pb = pb and pb or bzrlib.ui.ui_factory.progress_bar()
> >
> > I wanna give a -1 to this line. This construction (x and y or z) and
> > its pitfalls is actually the reason the ternary operator was added to
> > python 2.5 and even after long discussions about what it means, I
> > *still* find it confusing.
> >
> > A 4-line if/else will cost you screen real estate but win you the
> > love of your fellow man. :)
>
> Besides it will only be a 2-line if. The expression is screwed, but IMHO
> not for using and+or for ternary (I am used to that from other
> languages (that do have ternary, by the way)), but for:
> 1) Assigning what is already assigned.
> 2) Containing redundant terms -- (pb and pb) == pb
Right.
> In languages that have it I'd suggest pb or= ....progress_bar(), but
> python only supportst augmented assignment for arithmetic operators.
I'm just curious, what language has "assign if the LHS is null"? Perl6?
--
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060120/52041702/attachment.pgp
More information about the bazaar
mailing list