Mark Dickinson <[EMAIL PROTECTED]> added the comment: I still think this is the wrong solution, and should be fixed before 2.6; long(float('nan')) should raise ValueError. As Alexander points out, this fits much better with the IEEE 754 standard, and also with the C99 standard. It also just "feels right", to me; an attempt to convert a nan to an integer should not pass silently.
Here's a patch, based on Ronald's original patch. Christian, what was the motivation for returning 0 here? (One could also argue on the basis of IEEE 754 and C99 that long(float('inf')) should raise ValueError instead of OverflowError; personally, I'm content that long(float('inf')) raises an exception---I'm not too bothered which one.) I agree that there doesn't seem much value in backporting the fix. ---------- keywords: +patch Added file: http://bugs.python.org/file10957/issue1481296.patch _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1481296> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com