Index: Lib/decimal.py =================================================================== --- Lib/decimal.py (revision 76570) +++ Lib/decimal.py (working copy) @@ -3462,10 +3462,6 @@ if other._exp != 0: return context._raise_error(InvalidOperation) - liminf = -2 * (context.Emax + context.prec) - limsup = 2 * (context.Emax + context.prec) - if not (liminf <= int(other) <= limsup): - return context._raise_error(InvalidOperation) if self._isinfinity(): return Decimal(self) Index: Lib/test/test_decimal.py =================================================================== --- Lib/test/test_decimal.py (revision 76570) +++ Lib/test/test_decimal.py (working copy) @@ -68,6 +68,16 @@ skipped_test_ids = [ 'scbx164', # skipping apparently implementation-specific scaleb 'scbx165', # tests, pending clarification of scaleb rules. + + # the specification requires that the second argument to scaleb is + # in the range +-2 * (Emax + precision) inclusive. This rather + # arbitrary restriction, which doesn't appear in IEEE 754, appears + # to exist solely for the benefit of decimal implementations in + # low-level languages. For Python, we ignore this restriction + # and the associated tests. + 'ddscb122', 'ddscb123', 'ddscb126', 'ddscb127', + 'dqscb122', 'dqscb123', 'dqscb126', 'dqscb127', + 'scbx122', 'scbx123', 'scbx126', 'scbx127', ] # Make sure it actually raises errors when not expected and caught in flags