This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients christian.heimes, marco.buttu, mark.dickinson, terry.reedy
Date 2013-07-30.17:59:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I would prefer one type too, if it can be done gracefully enough. I had thought of a set-mode function (method), but anticipate objection to such modal action-at-distance behavior. A context manager, which I had not thought of, somewhat alleviates that objection, though not entirely. If code written in try-except manner is imported and run under the context manager, it might or might not work. My toy example would, in that the final array might contain Nans rather than Nones, which would be all right since the user would anticipate that, having asked for that. But if the imported code used exceptions to switch algorithms, switching from exceptions to inf/nan might not work so well.

Consistently replacing 'return inf/nan' and 'raise FPException' (where appropriate) with "if flag: return inf/nam; else: raise FPException" seems not too difficult ;-). But yes, a PEP rather than more piecemeal changes.
Date User Action Args
2013-07-30 17:59:58terry.reedysetrecipients: + terry.reedy, mark.dickinson, christian.heimes, marco.buttu
2013-07-30 17:59:58terry.reedysetmessageid: <>
2013-07-30 17:59:58terry.reedylinkissue18570 messages
2013-07-30 17:59:57terry.reedycreate