Terry J. Reedy added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18570>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to