Message2760
Instead of using the code in this patch, I implemented this by having the superclass of PyJavaInstance, PyInstance, defer to a method makeDefaultRepr in its __repr__ if the class represented by that PyInstance doesn't define a custom __repr__ method. Then I overrode the new method in PyJavaInstance to provide the Java instance specific behavior of calling toString on the javaProxy.
This has a couple benefits over the code in the patch. It doesn't recreate a lot of the code already in PyInstance to conditionally call a method on a class that the patch has in the __finditem__ then __finditem__.__call__ section. It also correctly chains calls from __str__ to __repr__ if __str__ doesn't exist instead of the other way around. This was wrong in PyJavaInstance as it stood, but it didn't matter up until now since __str__ and __repr__ were always identical. |
|
Date |
User |
Action |
Args |
2008-02-20 17:18:44 | admin | link | issue1761748 messages |
2008-02-20 17:18:44 | admin | create | |
|