[Persistence-sig] A simple Observation API

Guido van Rossum guido@python.org
Mon, 29 Jul 2002 17:18:43 -0400


Some questions about Phillip's Observable protocol.  Wby does it have
to be so complicated?  E.g. if you have to do something special for
method that touches an attribute without doing a setattr operation on
it, why not have the magic be inside that method rather than declare a
wrapper?  (The wrapper looks like it is much more expensive than
another way of flagging a change would be.)

What exactly is the point of collapsing multiple setattr() ops
together?  Just performance?  Or is there a semantic reason?  If just
performance, where is the time going that you're trying to save?

What's the use case for declaring a method as "touches an attribute
but that change should be ignored"?  (If it's only __init__, a
lighter-weight mechanism might be sufficient.)

--Guido van Rossum (home page: http://www.python.org/~guido/)