From tim at sitefusion.co.uk Tue Jul 5 01:33:18 2005 From: tim at sitefusion.co.uk (Tim Hicks) Date: Tue, 5 Jul 2005 00:33:18 +0100 (BST) Subject: [Email-SIG] patch to the email package? Message-ID: <2717.82.45.210.74.1120519998.squirrel@mail.zoper.com> Hi Barry (and the email-sig), I wrote to you (and the email-sig) a couple of times around the New Year about my attempts to persist email.Message.Message -derived instances in the ZODB. After a bit of a break from what I was up to, I need this again. A little more experimentation with the version 3.0 release and it seems like you have solved most of my issues :-). So far, the only problem I face is that Message.get_payload returns a list that is a reference to the actual payload i.e. in-place mutations of the list should affect the actual Message object. However, this doesn't play nicely with ZODB as lists don't automatically persist without _p_changed = 1 being set. I'd like to adjust set_payload so that it ensures that only PersistentList instances get stored as self._payload (by constructing one from the incoming standard list if necessary *). However, this causes a real problem because there is code all over the place that does: isinstance(self._payload, list) ... which fails if self._payload is a (UserList-inheriting) PersistentList. So, my question is this: would you accept a patch that changes all code like: isinstance(self._payload, list) to: isinstance(self._payload, (list, UserList) ) ? Cheers, Tim * I suppose this would be a source of potentially unexpected behaviour if users were used to being able to construct a list, add it as a Message payload, and then go on mutating it without fetching it out of the Message object again. Ah well, I think I can live with that.