[Zope3-dev] trigger persistence
Guido van Rossum
guido@python.org
Thu, 05 Sep 2002 17:31:38 -0400
> 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.
OTOH one could claim it exposes more internal details of the
persistence mechanisms. If in the future the persistence API changes
(e.g. you'd have to call self._p_changed(), or whatever), the latter
solution would break, while the former idom would (presumably) still
work.
--Guido van Rossum (home page: http://www.python.org/~guido/)