Lisp to Python translation criticism?

John E. Barham jbarham at jbarham.com
Sat Aug 17 06:36:22 CEST 2002


"Sean 'Shaleh' Perry" wrote:

> import operator
> prod = reduce(operator.mul, probs) # for those who dislike lambda (-:
>
> Personally, I would do this closer to the use of prod.  It looks like you
mean
> to use it but only use it in the last two lines.

Yeah, as I said in another reply, I forgot about reduce.  Thanks for the
reminder.

> > Any comments on the correctness, style, efficiency etc. of my
translation?
> > I'd like to write a Python spam filtering system using Graham's
techniques.
>
> I was pondering doing this and then using a pickle to retrieve the tables.
> What were you considering?

Pickling works for me.  Using a database would be overkill.  It should be
relatively straightforward to run a cron job to update a pickled dictionary
based on the day's new mail.  Assuming it stays on the server of course.
I'm still thinking about how this works for POP3 clients...

    John





More information about the Python-list mailing list