[issue18570] OverflowError in division: wrong message

Mark Dickinson report at bugs.python.org
Sun Aug 4 09:30:24 CEST 2013


Mark Dickinson added the comment:

> With that fixed, I am inclined to close this.

Agreed.  I'll try to find some time for a PEP at some point in the next few weeks.

> I had thought of a set-mode function (method), but anticipate objection
> to such modal action-at-distance behavior.

Yes;  I'm not a big fan of global state[*] either in general, but there aren't many other good options:  specifying the mode to each operation individually would be painful and prevent natural use of infix operators, generally making code more unreadable.  There *would* need to be some kind of set-mode function (or perhaps writable sys module attribute) as you suggest, but the context manager could be promoted as the recommended way to change the state in a manner that's reasonably safe and explicit.


[*] We'd want it to be thread-local rather than global, of course.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18570>
_______________________________________


More information about the Python-bugs-list mailing list