Inadvertent re-defining function names in Jython

Useful hints
Post Reply
User avatar
tomw
Posts: 296
Joined: Tue Dec 23, 2008 3:40 pm

Inadvertent re-defining function names in Jython

Post 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 *
Post Reply