
April 30, 2011
5:35 a.m.
Terry Reedy writes:
On 4/29/2011 6:50 PM, Alexander Belopolsky wrote:
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?
Adding FloatWarning would probably be easier than changing behavior to raise an exception. People who care could change into an exception.
+1 That looks both formally compliant and much better than allowing what is often a programming error to fail silently.