[Persistence-sig] "Straw Baby" Persistence API

Jeremy Hylton jeremy@zope.com
Mon, 22 Jul 2002 16:03:11 -0400 (EDT)


>>>>> "GvR" == Guido van Rossum <guido@python.org> writes:

  GvR> I've often thought that it's ugly that you have to set _p_state
  GvR> and _p_changed, rather than do these things with method calls.
  GvR> What do you think about that?  Especially the conventions for
  GvR> _p_state look confusing to me.

I would like to keep a simplified version of _p_changed, but not
_p_state.  The purpose of assignment to _p_changed is to mark an
object as changed.  Assignment seems clear here.  _p_changed is a
flag, normally false; when an object is changed, it is set to true.
Why would a method call be any clearer?

In general, it seems Python programs often use instance variables in
this way, and the property mechanism only makes it easier for
something like looks like assignment to behave in special ways.

I don't think there's any need to make _p_state part of the documented
API, although it may be useful to keep for debugging.

Jeremy