On Nov 17, 2:54 pm, [EMAIL PROTECTED] (Cameron Laird) wrote:
> In article <[EMAIL PROTECTED]>,
> Tim Chase  <[EMAIL PROTECTED]> wrote:
>                         .
>                         .
>                         .>To the OP, I think rather than cluttering my code, 
> I'd just
> >create a loop
>
> >   for i in [x1,x2,x3,x4,...x1024]:
> >     a[i] = False
>
>                         .
>                         .
>                         .
> I much prefer this, too.
>
> I've been trying to decide if there's any sober reason to advocate
> the one-liner
>
>     map(lambda i: a.__setitem__(i, False), [x1, x2, x3, ..., x1024])
>
> My answer:  no.

well, the OP was "...faster?" not "best, cleanest, pythonic..."  so
the reason would be speed.

(looks faster, don't know for sure)
(and yeah, looks ugly.  but we need the speed...)

Carl K
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to