]> granicus.if.org Git - python/commitdiff
Fix final documentation nits before backporting decimal module fixes to 2.5
authorNick Coghlan <ncoghlan@gmail.com>
Sun, 3 Sep 2006 01:02:00 +0000 (01:02 +0000)
committerNick Coghlan <ncoghlan@gmail.com>
Sun, 3 Sep 2006 01:02:00 +0000 (01:02 +0000)
Doc/lib/libdecimal.tex
Doc/whatsnew/whatsnew25.tex

index b046aa31f6e38e3da6bfeb3c1f8b6ec64cff7d96..447427bb40d5b04083f548da4812690da7256bee 100644 (file)
@@ -453,12 +453,12 @@ active context.
   no context is specified, a copy of the current context is used.
   \versionadded{2.5}
 
-  For example, the following code increases the current decimal precision
-  by 42 places, performs a calculation, and then automatically restores
+  For example, the following code set the current decimal precision
+  to 42 places, performs a calculation, and then automatically restores
   the previous context:
 \begin{verbatim}
     from __future__ import with_statement
-    import decimal
+    from decimal import localcontext
 
     with localcontext() as ctx:
         ctx.prec = 42   # Perform a high precision calculation
index 1c49809c93ec9db689cdd22f81abb614e0e67320..4272ce3af60af075929d971aaca9213fd3cecc40 100644 (file)
@@ -683,9 +683,10 @@ with lock:
 The lock is acquired before the block is executed and always released once 
 the block is complete.
 
-The \module{decimal} module's contexts, which encapsulate the desired
-precision and rounding characteristics for computations, provide a 
-\function{localcontext()} function for getting a context manager:
+The new \function{localcontext()} function in the \module{decimal} module
+makes it easy to save and restore the current decimal context, which
+encapsulates the desired precision and rounding characteristics for
+computations:
 
 \begin{verbatim}
 from decimal import Decimal, Context, localcontext