GalSim-developers/GalSim — pull request #605 by rmjarvis (2014-10-20 14:19:09+00:00)
Title: #604 Change comparisons with None to use `is` or `is not` rather than `==` or `!=`

Numpy 1.9 won't like things like `if image.array == None`, since it will start comparing each element to None rather than the desire check of whether the whole thing is None. It is better form in general ("more pythonic") to write `if image.array is None` anyway, so I actually changed all uses of the former syntax to `is None`. Likewise `!= None` -> `is not None`.

The only hiccup was in the boost python wrapping. We checked if the attribute != `bp::object()` which is the normal way to compare to None in the C++ layer. But that actually calls back to numpy's overloaded op== function, so it also had to be changed. I'm not actually sure how to do an `is not` in the boost python context, so I just get the ptr and compare that to 0, which is the C++ equivalent to what we mean here.