Message3802

Author MrMeanie
Recipients MrMeanie, fwierzbicki, zyasoft
Date 2008-11-22.13:12:22
SpamBayes Score 5.7534533e-12
Marked as misclassified No
Message-id <1227359543.83.0.766094267487.issue1148@psf.upfronthosting.co.za>
In-reply-to
Content
New Patch (supercedes previous 2)

This patch fixes the remaining issues.

1) CollectionProxy.findCollection() will use VectorProxy if to wrap
java.util.Vector objects.
2) VectorProxy now derives from ListProxy.
3) PyInstance checks methods from underlying Java/Python object before
trying the collection proxy. This means that a Java or Python object
that implements __len__, __iter__, __getitem__, __setitem__, or
__delitem__, and derives from a Java collection class, will be able to
control the behavior of these methods. Previously, the collection proxy
intervened and translated these calls to the underlying Java collection
methods (get/set/put/etc). This also affected Python objects that
derived from java.util.List (for example) in the same way.

#3 Was accomplished by:
a) A new set of invoke methods were implemented for collection proxy
work; iinvoke_collectionProxy(). These return a special error value
rather than throwing the AttributeError, to indicate the no method could
be found. This allows the __finditem__/__setitem__/etc to try the
collection proxy should it be available, before raising this exception.
b) The __finditem__/__setitem__/__delitem__ were modified to try the
invoke path before trying the collection proxy.

'test_CollectionProxy.py' has been updated to test this functionality.
History
Date User Action Args
2008-11-22 13:12:23MrMeaniesetmessageid: <1227359543.83.0.766094267487.issue1148@psf.upfronthosting.co.za>
2008-11-22 13:12:23MrMeaniesetrecipients: + MrMeanie, fwierzbicki, zyasoft
2008-11-22 13:12:23MrMeanielinkissue1148 messages
2008-11-22 13:12:23MrMeaniecreate