Bug in rfc822

Oleg Broytmann phd at phd.fep.ru
Wed Jul 11 11:24:53 EDT 2001


On Wed, 11 Jul 2001, Steve Holden wrote:
> > Playing with rfc822 is good, but i think mailbox.py has also several
> > problems. When you do mailbox.next(), the function return a rfc822.Message
> > but i wanted to use my class MyMessage, so i have to rewrite :
> >
> > class MyUnixMailbox(mailbox.UnixMailbox):
> >     def next(self):
[skip]
> > return MyMessage(mailbox._Subfile(self.fp, start, stop))
> >
> > Do you know of any prettier solution ?
>
> I've come across the same impedance mismatch myself, and adopted more or
> less the same solution. It would clearly be nice to be able to pass the
> mailbox's __init__() method an (optional, defaulting to rfc822.Message)
> class which that mailbox would then use when it was creating messages. The
> class would obviously need to comply with (a subset of) the rfc822.Message
> interface.
>
> Maybe this upwardly-compatible solution could be adopted for the rfc2822
> library?

   Have anyone of you looked into mailbox.py from Python 2.1? :) I
recommend to look there and find all your ni^H^Hdreams came true :)))

Oleg.
----
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.





More information about the Python-list mailing list