Comment 3 for bug 254901

Barry Warsaw (barry) wrote :

You could potentially inherit bug.tags from built-in list and do the overriding (i.e. proxying), but it's kind of a tricky situation. It reminds me of the workarounds that something like ZODB has to do.

The easiest thing to do would be to expose a method that allowed you to mark an attribute as dirty so that you could explicitly say, e.g. to save tags when you call lp_save().

I'm not sure the idea of caching the mutable objects is workable. They could be very large, and you'd have to keep a unique copy to do the comparison. You could just always save any mutable attributes, but I'm not sure that the wadl gives you that information.

So I think the simplest solution is also the most explicit:

>>> b.tags.append('foo')
>>> b.lp_mark('tags')
>>> b.lp_save() # patches tags