improving a huge double-for cycle

giltay at gmail.com giltay at gmail.com
Fri Sep 19 11:47:03 EDT 2008


On Sep 18, 7:42 pm, Steven D'Aprano <st... at REMOVE-THIS-
cybersource.com.au> wrote:
> I'm not being snarky about losing priority here, but I submitted
> essentially the same solution two hours earlier than pruebono.

My apologies (seriosuly).  In this case, I think it might just be
haste.  For what it's worth, I saw your post (on Google Groups), but I
skipped over it.  You wrote two solutions, one slow and one fast (the
latter being the same as pruebono's).  You put the slow one at the
top, I saw

for ...
    for ...

and went straight to the next message without reading the better
solution.  I knew that there was only one for loop necessary, so I
didn't bother reading on.  Actually, I missed pruebono's post, too,
until after I figured it out myself (but before I posted).

That several people came up with the nigh exact same solution, modulo
variable names only, says something about the Zen of Python.

Geoff G-T




More information about the Python-list mailing list