Message4599
When Java proxy classes are generated for python classes, they only create overriding Java methods for method names
present in the Python class at the time of creation. This means if someone adds methods to an instance of a Python
subclass of a Java class and expects them to be called from Java as it would be from a regular python class, it won't
happen. It also means __getattr__ and the like won't work for overriding Java methods unless the name was present at
the time of creation.
This has been the case since the beginning of time, and fixing it would slowdown Python subclasses of Java -- this
would cause a Python lookup every time a method is invoked in Java -- but it seems like the right thing to do to keep
from surprising people. The obvious thing to do is to eliminate addMethod in JavaMaker, and add some checking to
ProxyMaker to keep it from generating overriding methods for the proxy methods it already adds. Unfortunately this
generates some stack-busting recursion in constructors that I haven't looked into, and it's probably too close to 2.5
to do this anyway. |
|
Date |
User |
Action |
Args |
2009-04-27 01:04:52 | cgroves | set | recipients:
+ cgroves |
2009-04-27 01:04:51 | cgroves | set | messageid: <1240794291.88.0.48747262017.issue1329@psf.upfronthosting.co.za> |
2009-04-27 01:04:51 | cgroves | link | issue1329 messages |
2009-04-27 01:04:51 | cgroves | create | |
|