[Zope-dev] Using zope.proxy for read-only instances
Andreas Kopecky
andreas.kopecky at meduniwien.ac.at
Mon Dec 22 06:37:34 EST 2008
Hi,
Well if it's invalid i won't bother with it but say:
- i forgot a self - that is true
- if added it does NOT loop infinitely
- its not my example its taken from python cookbook
- it works with new style objects - __getattribute__ does something
different
But frankly i was only trying to understand better what you want to do
and be helpful - which obviously is neither needed nor wanted.
Andreas
> Sorry, invalid answer. That's what zope.proxy is designed for and I am
> trying to get it working (unlikely it has no documentation and the
> unittest don't give me much insight). In addition: your code won't work
> since you must refer to self.obj not 'obj' within __getattr__. And
> using self.obj will lead to an infinite recursion. I also think that
> __getattr__() is not used by new-styles classes. Instead you need to
> override __getattribute__().
>
> Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 549 bytes
Desc: OpenPGP digital signature
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20081222/22da0729/attachment.bin
More information about the Zope-Dev
mailing list