[Python-checkins] r51693 - in python/trunk/Doc: lib/libdecimal.tex whatsnew/whatsnew25.tex

nick.coghlan python-checkins at python.org
Sun Sep 3 03:02:03 CEST 2006


Author: nick.coghlan
Date: Sun Sep  3 03:02:00 2006
New Revision: 51693

Modified:
   python/trunk/Doc/lib/libdecimal.tex
   python/trunk/Doc/whatsnew/whatsnew25.tex
Log:
Fix final documentation nits before backporting decimal module fixes to 2.5

Modified: python/trunk/Doc/lib/libdecimal.tex
==============================================================================
--- python/trunk/Doc/lib/libdecimal.tex	(original)
+++ python/trunk/Doc/lib/libdecimal.tex	Sun Sep  3 03:02:00 2006
@@ -453,12 +453,12 @@
   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

Modified: python/trunk/Doc/whatsnew/whatsnew25.tex
==============================================================================
--- python/trunk/Doc/whatsnew/whatsnew25.tex	(original)
+++ python/trunk/Doc/whatsnew/whatsnew25.tex	Sun Sep  3 03:02:00 2006
@@ -683,9 +683,10 @@
 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


More information about the Python-checkins mailing list