Message4633

Author MrMeanie
Recipients MrMeanie
Date 2009-05-05.06:21:47
SpamBayes Score 2.612321e-10
Marked as misclassified No
Message-id <1241504581.4.0.354783750014.issue1338@psf.upfronthosting.co.za>
In-reply-to
Content
When two Java objects 'a' and 'b' are compared in Python with the ==
Python operator, and the class of 'b' is not a subclass of the class of
'a', the Java equals method on 'a' receives a PySingleton, representing
an error.

This is caused by the __eq__ implementation provided by PyJavaType
unwrapping the 'b' object, and asking for it to be cast to the same type
as 'a'.

This can be demonstrated by constructing a java.util.ArrayList and a
java.util.Vector, both with the same contents, and comparing them.
Using the 'equals()' method from the Jython shell will result in True,
but using == will result in 'False'.
History
Date User Action Args
2009-05-05 06:23:34MrMeaniesetrecipients: + MrMeanie
2009-05-05 06:23:01MrMeaniesetmessageid: <1241504581.4.0.354783750014.issue1338@psf.upfronthosting.co.za>
2009-05-05 06:22:19MrMeanielinkissue1338 messages
2009-05-05 06:22:12MrMeaniecreate