diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-02-18 14:45:33 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-02-18 14:45:33 (GMT) |
commit | 456e1652cf63dfbd3b1d0af81af9582d204ddd02 (patch) | |
tree | c3da927a4aae6f712d441db72f4553db06831aff /Lib | |
parent | 6d8effb1fc6660921e5f61fdc2c898e86356c64b (diff) | |
download | cpython-456e1652cf63dfbd3b1d0af81af9582d204ddd02.zip cpython-456e1652cf63dfbd3b1d0af81af9582d204ddd02.tar.gz cpython-456e1652cf63dfbd3b1d0af81af9582d204ddd02.tar.bz2 |
Doctest fixes for decimal.py: add an integer-argument doctest for logical_invert; don't use integer literals with a leading zero.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/decimal.py | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index 768f60c..a10bdf2 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -4460,12 +4460,12 @@ class Context(object): Decimal('1000') >>> ExtendedContext.logical_and(Decimal('1111'), Decimal('10')) Decimal('10') - >>> ExtendedContext.logical_and(10, 01) - Decimal('0') - >>> ExtendedContext.logical_and(Decimal(10), 01) - Decimal('0') - >>> ExtendedContext.logical_and(10, Decimal(01)) - Decimal('0') + >>> ExtendedContext.logical_and(110, 1101) + Decimal('100') + >>> ExtendedContext.logical_and(Decimal(110), 1101) + Decimal('100') + >>> ExtendedContext.logical_and(110, Decimal(1101)) + Decimal('100') """ a = _convert_other(a, raiseit=True) return a.logical_and(b, context=self) @@ -4483,6 +4483,8 @@ class Context(object): Decimal('0') >>> ExtendedContext.logical_invert(Decimal('101010101')) Decimal('10101010') + >>> ExtendedContext.logical_invert(1101) + Decimal('111110010') """ a = _convert_other(a, raiseit=True) return a.logical_invert(context=self) @@ -4504,12 +4506,12 @@ class Context(object): Decimal('1110') >>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10')) Decimal('1110') - >>> ExtendedContext.logical_or(10, 01) - Decimal('11') - >>> ExtendedContext.logical_or(Decimal(10), 01) - Decimal('11') - >>> ExtendedContext.logical_or(10, Decimal(01)) - Decimal('11') + >>> ExtendedContext.logical_or(110, 1101) + Decimal('1111') + >>> ExtendedContext.logical_or(Decimal(110), 1101) + Decimal('1111') + >>> ExtendedContext.logical_or(110, Decimal(1101)) + Decimal('1111') """ a = _convert_other(a, raiseit=True) return a.logical_or(b, context=self) @@ -4531,12 +4533,12 @@ class Context(object): Decimal('110') >>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10')) Decimal('1101') - >>> ExtendedContext.logical_xor(10, 01) - Decimal('11') - >>> ExtendedContext.logical_xor(Decimal(10), 01) - Decimal('11') - >>> ExtendedContext.logical_xor(10, Decimal(01)) - Decimal('11') + >>> ExtendedContext.logical_xor(110, 1101) + Decimal('1011') + >>> ExtendedContext.logical_xor(Decimal(110), 1101) + Decimal('1011') + >>> ExtendedContext.logical_xor(110, Decimal(1101)) + Decimal('1011') """ a = _convert_other(a, raiseit=True) return a.logical_xor(b, context=self) |