[issue7633] decimal.py: type conversion in context methods

Stefan Krah report at bugs.python.org
Tue Jan 26 19:41:30 CET 2010


Stefan Krah <stefan-usenet at bytereef.org> added the comment:

If none of you is working on it right now, I'll produce a new patch.
Mark, how about this:

     def __add__(self, other, context=None, raiseit=False):
        """Returns self + other.

        -INF + INF (or the reverse) cause InvalidOperation errors.
        """
        other = _convert_other(other, raiseit)
        if other is NotImplemented:
            return other


Then the context functions could look cleaner.

----------

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


More information about the Python-bugs-list mailing list