[Mailman-Developers] Is there a stupid Python trick to save me?

Dan Mick Dan Mick <dmick@utopia.West.Sun.COM>
Wed, 13 Mar 2002 18:04:27 -0800 (PST)


I had an interesting thing happen today; a list started to get two
footers added to it.  Odd.

Then I remembered why:  I'd defined a pipeline for this list that had
an extra module in it (my "BounceImplicit" module that just rejects
Bccs; the custom list pipeline contained the old default + Bounce
Implicit).

But now, Decorate shouldn't be in the pipeline, since it's called by
SMTPDirect directly with the latest changes to SMTPDirect.  So my
pipeline calls it once explicitly and once implicitly.  Oops.

It occurred to me that if there were some way to have a 'lazy
evaluate' in a Python variable, I could maybe work around that, by
saying "list.pipeline = mm_cfg.GLOBAL_PIPELINE + 'BounceImplicit' (or
something like that) That way, if GLOBAL_PIPELINE changes, I still
get the right effect.

But I don't know how I might mechanize something like that without
hacking the code.

Am I smoking something, or is there some stupid Python trick that
would allow "dynamic list composition from a value"?

(Alternatively, would it be worth having something that allows "add
to the pipeline at a defined location" declarations, so that people
can add custom modules but still track changes to the source?  I
realize that as an alpha tester I'm in a bit of a unique situation,
but..)