From: Geoffrey French <report@bu...> - 2009-05-05 06:23:47
New submission from Geoffrey French <frondit1985@...>:
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
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
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'.
title: Comparing Java objects to each other fails when classes of values do not match
Jython tracker <report@...>
Get latest updates about Open Source Projects, Conferences and News.