Page 1 of 1

Inadvertent re-defining function names in Jython

Posted: Mon Aug 20, 2012 2:30 pm
by tomw
If you get a Jython error like:

Code: Select all

"TypeError: 'visad.meteorology.ImageSequenceImpl' object is not callable "

it may be that the function (method) you are using has been redefined. For example, if in your script (or your typing) you said:

Code: Select all

mask = a

then the built-in function "mask()" is now redefined to be whatever "a" is...and if you then tried to use the function mask(), you may get an error message like the above. If this happens, you would need to re-import the functions. In the case of "mask()", it is part of the VisAD library, and you could do:

Code: Select all

from visad.python.JPythonMethods import *