RE: [ZODB-Dev] Dynamic Wrapper?

2005-12-16 Thread Tim Peters
[Chris Spencer] > Instead of requiring all persistable objects to inherit a special class, > wouldn't it be possible to dynamically wrap a class's __setattr__ and/or > __setitem__ methods to determine when an object's been modified? I'm not clear on what you're trying to accomplish, but any persis

Re: [ZODB-Dev] Dynamic Wrapper?

2005-12-16 Thread Chris Withers
Chris Spencer wrote: I understand this has some drawbacks. Namely, it will only work for new-style classes, but for a large code base this might be easier than manually writing _p_changed = 1 everywhere. The number of times you end up actually having to write this is pretty minimal ;-) Chri

[ZODB-Dev] Dynamic Wrapper?

2005-12-15 Thread Chris Spencer
Instead of requiring all persistable objects to inherit a special class, wouldn't it be possible to dynamically wrap a class's __setattr__ and/or __setitem__ methods to determine when an object's been modified? Something like: class Monitor(object): class Proxy(object): def __init