[Zope3-dev] Backward-incompatible bug fix to zope.proxy
Roger Ineichen
dev at projekt01.ch
Mon Apr 3 06:12:34 EDT 2006
Jim Fulton schrieb:
[...]
>> Hi Jim,
>>
>> We just use a IContainer location proxy adapter.
>> But since this adapter isn't persistent I don't think this
>> is a problem.
>>
>> def proxify(container, item):
>> if IContainer.providedBy(item):
>> proxy = ContainerLocationProxy(item)
>> else:
>> proxy = LocationProxy(item)
>> proxy.__name__ = item.__name__
>> proxy.__parent__ = container
>> return proxy
>>
>> class ContainerLocationProxy(LocationProxy):
>> """Proxy the location of a container an its items."""
>>
>> # zope.app.conatiner.interfaces.IReadContainer
>> def __getitem__(self, key):
>> return proxify(self, getProxiedObject(self).__getitem__(key))
>>
>> ...
>
> Well, with the fix, your __getitem__ won't be called. Is that a
> problem? ;)
>
> You will need to use the @non_overridable decorator on your __getitem__
> function.
If I understand this correctly, then we only have to update the methods
with decorators? If so, this will be fine for me.
> Jim
>
--
Regards
Roger Ineichen
_____________________________
Projekt01 GmbH
www.projekt01.ch
Boesch 65
6331 Hünenberg
phone +41 (0)41 781 01 78
mobile +41 (0)79 340 52 32
fax +41 (0)41 781 00 78
email roger.ineichen at projekt01.ch
_____________________________
END OF MESSAGE
More information about the Zope3-dev
mailing list