Message4633
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'. |
|
Date |
User |
Action |
Args |
2009-05-05 06:23:34 | MrMeanie | set | recipients:
+ MrMeanie |
2009-05-05 06:23:01 | MrMeanie | set | messageid: <1241504581.4.0.354783750014.issue1338@psf.upfronthosting.co.za> |
2009-05-05 06:22:19 | MrMeanie | link | issue1338 messages |
2009-05-05 06:22:12 | MrMeanie | create | |
|