[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[IDV #HNT-802608]: Request to change jython "shell" utilities
- Subject: [IDV #HNT-802608]: Request to change jython "shell" utilities
- Date: Wed, 11 May 2011 14:07:55 -0600
> 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.
Yuan
>
> --
> 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