[ZPT] repeat trick

Peter Bengtsson mail@peterbe.com
Wed, 11 Jul 2001 16:56:14 +0200


cheers!
thanks for the helpful support and response.
long live "your" project Evan.

----- Original Message -----
From: "Evan Simpson" <evan@digicool.com>
To: "Peter Bengtsson" <mail@peterbe.com>
Cc: "Matthew Almond" <malmond@bw.edu>; <zpt@zope.org>
Sent: Wednesday, July 11, 2001 4:06 PM
Subject: Re: [ZPT] repeat trick


> Peter Bengtsson wrote:
>
> > which one is best
> >
> > """
> > tal:content="python:test(users, string.join(users, '\n'), '')"
> > """
> > or
> > """
> > tal:content="python:string.join(users or [],'\n')"
> > """
>
> The second one is "best", in the sense that it works, while the first
> one doesn't :-)  As someone pointed out, the first one will fail because
> the join is evaluated whether "users" is true or not, raising an
exception.
>
> Cheers,
>
> Evan @ digicool
>