|
From: Stuart S. <st...@me...> - 2001-06-29 21:31:57
|
It isn't clear to me how object 'y' would be of Class myJavaClass2... Without any additional information, I would expect Jython to assign y to be a reference to x, of Class myJavaClass1. Unless y had been previously instantiated or referenced to (assigned to?) an object of Class myJavaClass2. I have had some difficulty in dealing with this (upcasting) in Java, and resorted to a shallow copy based on reflection... Stuart Kevin Butler wrote: > marco wrote: > > > > hy there, > > > > how can i cast a java-instance to another type. > > ex. > > x = myJavaClass1() > > y = (myJavaClass2) x > > In Jython, that looks like: > > x = myJavaClass1() > y = x > > :-) > > No casts needed. > > kb > > _______________________________________________ > Jython-dev mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-dev |