|
From: Roman M. <ro...@sp...> - 2001-06-30 00:18:34
|
>>>>> "BZ" == Brian Zhou <bri...@ya...> writes:
BZ> In dynamic languages like Python/Smalltalk/Scheme, you usually
BZ> don't need cast. Because "the methods a particular instance
BZ> can perform" becomes the type of the instance, it's not as
BZ> important which class that instance actually belongs. At
BZ> instantiation time, "all the methods the instance can perform"
BZ> is determined. At runtime, you either can call the method or
BZ> you get an AttributeError.
What if you need to pass an object to a java method that requires it
to be cast to a different java type?
What if one java method gives me an Object back, but it is actually a
String. I have another java method that requires a String argument. Is
there a way to do that cast in jython?
I ran in to this when trying to use the Java xml-rpc library from
jython.
^Roman
|