Stefan Krah added the comment: The behavior is according to the specification:
http://speleotrove.com/decimal/decarith.html The idea behind it is that 1/0 can be reasonably defined as infinity, whereas 0/0 is undefined. You can see that if you disable the exceptions: >>> c = getcontext() >>> c.traps[DivisionByZero] = False >>> c.traps[InvalidOperation] = False >>> >>> Decimal(1) / 0 Decimal('Infinity') >>> Decimal(0) / 0 Decimal('NaN') >>> ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22306> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com