[Python-ideas] Disallow orderring comparison to NaN
alexander.belopolsky at gmail.com
Sat Apr 30 00:50:05 CEST 2011
On Fri, Apr 29, 2011 at 5:30 PM, Alexander Belopolsky
<alexander.belopolsky at 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?
More information about the Python-ideas