[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[IDV #HNT-802608]: Request to change jython "shell" utilities

> Hi Yuan & Julien --
> Related to the explicit testing for "null" in the Java code, we also
> found that in a few places in 3 of the .py files (shell.py, grid.py
> and maps.py) there are statements like:
> a = getSomething()
> if (a == None) doSomething...
> The problem here, as related to the one you just fixed in Java, is
> that if "a" is a class and has an "equals" or "__eq__" (or __ne__)
> method, this will be called when the
> "if (a == None") is done.  The Jython code should be changed to
> if (a is None) doSomething...
> or
> if (a is not None) doSomething...
> This form does not result in the interpreter calling the Java method,
> and so is "safe" in this situation (when testing against "None").
> I have attached a zip file with updates to the 3 py files I mentioned
> above.  Hopefully, you will be able to have time to check these and
> update the IDV resource/python/ files
> accordingly.
> Thanks.
> tom

Hi Tom,
   I checked in the changes, thanks for these updates.

> --
> Tom Whittaker
> University of Wisconsin-Madison
> Space Science & Engineering Center (SSEC)
> Cooperative Institute for Meteorological Satellite Studies (CIMSS)
> 1225 W. Dayton Street
> Madison, WIÂ 53706Â USA
> ph: +1 608 262 2759

Ticket Details
Ticket ID: HNT-802608
Department: Support IDV
Priority: Normal
Status: Closed

NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.