I get the following error:
$ jython clone.py
Traceback (innermost last):
File "clone.py", line 13, in ?
File "clone.py", line 7, in clone
AttributeError: class 'java.lang.Object' has no attribute 'clone'
For the following short code example
from java.lang import *
class MyClone(Object, Cloneable):
def __init__(self):
self.x = 4
def clone(self):
return Object.clone(self) # the line that is being
complained about
if __name__=='__main__':
x = MyClone()
y = x.clone()
print y.x
-------------------------
clone() is protected on Object, so I guess I'm not calling the default
super clone function correctly. In Java you would:
return super.clone()
How do I do this in Jython?
Any info appreciated.
|