
April 29, 2011
10:50 p.m.
On Fri, Apr 29, 2011 at 5:30 PM, Alexander Belopolsky <alexander.belopolsky@gmail.com> wrote: ..
As I mentioned before, Python does not have a mechanism that would allow to simultaneously raise an exception and deliver the result. We have to choose one or the other.
I made this argument several times and it went unchallenged, but I now realize that Python does have a mechanism that would allow to simultaneously raise an exception and deliver the result. This is what warnings do. Since changing NaN < 0 to raise an error would have to be done by issuing a deprecation warning first, why can't we just issue appropriate warning on invalid operations? Isn't this what numpy does in some cases?