[Zope3-dev] Re: trigger persistence
Jim Fulton
jim@zope.com
Thu, 05 Sep 2002 17:31:11 -0400
Jeremy Hylton wrote:
> I've seen code that says this:
>
> self._registry = self._registry #trigger persistence, if pertinent
>
> Wouldn't it be clearer to say this directly?
>
> self._p_changed = 1
>
> Then there would be no mystery and no need for a comment.
Well, yes, but, the former will work for non-persistent
objects without creating an extraneous attribute. I encouraged people
to do the former, but *now* tend to lean toward the later, especially
when you know you are persistent. The former is still handy in mix-ins that
*might or might not* be used with persistence.
Jim
--
Jim Fulton mailto:jim@zope.com Python Powered!
CTO (888) 344-4332 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org