Index: Doc/library/decimal.rst =================================================================== --- Doc/library/decimal.rst (revision 87951) +++ Doc/library/decimal.rst (working copy) @@ -144,7 +144,7 @@ >>> Decimal((0, (3, 1, 4), -2)) Decimal('3.14') >>> Decimal(str(2.0 ** 0.5)) - Decimal('1.41421356237') + Decimal('1.4142135623730951') >>> Decimal(2) ** Decimal('0.5') Decimal('1.414213562373095048801688724') >>> Decimal('NaN') Index: Doc/library/difflib.rst =================================================================== --- Doc/library/difflib.rst (revision 87951) +++ Doc/library/difflib.rst (working copy) @@ -159,7 +159,7 @@ >>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n'] >>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n'] >>> for line in context_diff(s1, s2, fromfile='before.py', tofile='after.py'): - ... sys.stdout.write(line) # doctest: +NORMALIZE_WHITESPACE + ... print(line, end='') # doctest: +NORMALIZE_WHITESPACE *** before.py --- after.py *************** @@ -197,7 +197,7 @@ >>> import keyword >>> get_close_matches('wheel', keyword.kwlist) ['while'] - >>> get_close_matches('apple', keyword.kwlist) + >>> get_close_matches('apple', keyword.kwlist, cutoff=0.7) [] >>> get_close_matches('accept', keyword.kwlist) ['except'] @@ -292,7 +292,7 @@ >>> s1 = ['bacon\n', 'eggs\n', 'ham\n', 'guido\n'] >>> s2 = ['python\n', 'eggy\n', 'hamster\n', 'guido\n'] >>> for line in unified_diff(s1, s2, fromfile='before.py', tofile='after.py'): - ... sys.stdout.write(line) # doctest: +NORMALIZE_WHITESPACE + ... print(line, end='') # doctest: +NORMALIZE_WHITESPACE --- before.py +++ after.py @@ -1,4 +1,4 @@ Index: Doc/library/turtle.rst =================================================================== --- Doc/library/turtle.rst (revision 87951) +++ Doc/library/turtle.rst (working copy) @@ -1878,7 +1878,7 @@ >>> cv = screen.getcanvas() >>> cv - + .. function:: getshapes() Index: Doc/library/collections.rst =================================================================== --- Doc/library/collections.rst (revision 87951) +++ Doc/library/collections.rst (working copy) @@ -120,6 +120,7 @@ >>> c = Counter(a=4, b=2, c=0, d=-2) >>> d = Counter(a=1, b=2, c=3, d=4) >>> c.subtract(d) + >>> c Counter({'a': 3, 'b': 0, 'c': -3, 'd': -6}) .. versionadded:: 3.2 @@ -544,7 +545,7 @@ ... d[k].add(v) ... >>> list(d.items()) - [('blue', set([2, 4])), ('red', set([1, 3]))] + [('blue', {2, 4}), ('red', {1, 3})] :func:`namedtuple` Factory Function for Tuples with Named Fields @@ -587,7 +588,7 @@ .. doctest:: - :options: +NORMALIZE_WHITESPACE + :options: +NORMALIZE_WHITESPACE,+REPORT_UDIFF >>> # Basic example >>> Point = namedtuple('Point', 'x y') @@ -626,15 +627,16 @@ 'Return a new Point object replacing specified fields with new values' result = _self._make(map(kwds.pop, ('x', 'y'), _self)) if kwds: - raise ValueError('Got unexpected field names: %r' % list(kwds.keys())) + raise ValueError('Got unexpected field names: %r' % kwds.keys()) return result def __getnewargs__(self): - 'Return self as a plain tuple. Used by copy and pickle.' + 'Return self as a plain tuple. Used by copy and pickle.' return tuple(self) x = _property(_itemgetter(0), doc='Alias for field number 0') y = _property(_itemgetter(1), doc='Alias for field number 1') + >>> p = Point(11, y=22) # instantiate with positional or keyword arguments >>> p[0] + p[1] # indexable like the plain tuple (11, 22) Index: Doc/library/operator.rst =================================================================== --- Doc/library/operator.rst (revision 87951) +++ Doc/library/operator.rst (working copy) @@ -9,7 +9,7 @@ .. testsetup:: import operator - from operator import itemgetter + from operator import itemgetter, iadd The :mod:`operator` module exports a set of functions implemented in C