diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2006-09-03 01:02:00 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2006-09-03 01:02:00 (GMT) |
commit | f1f42d850f92f84a387d8b0190752ae32e063736 (patch) | |
tree | eb633a1fe1c71b6e1a7fd2c8bfc662864c763d5b | |
parent | c1120b4b667b1231eb2a57bd31de4b6c0572100a (diff) | |
download | cpython-f1f42d850f92f84a387d8b0190752ae32e063736.zip cpython-f1f42d850f92f84a387d8b0190752ae32e063736.tar.gz cpython-f1f42d850f92f84a387d8b0190752ae32e063736.tar.bz2 |
Fix final documentation nits before backporting decimal module fixes to 2.5
-rw-r--r-- | Doc/lib/libdecimal.tex | 6 | ||||
-rw-r--r-- | Doc/whatsnew/whatsnew25.tex | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/Doc/lib/libdecimal.tex b/Doc/lib/libdecimal.tex index b046aa3..447427b 100644 --- a/Doc/lib/libdecimal.tex +++ b/Doc/lib/libdecimal.tex @@ -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 diff --git a/Doc/whatsnew/whatsnew25.tex b/Doc/whatsnew/whatsnew25.tex index 1c49809..4272ce3 100644 --- a/Doc/whatsnew/whatsnew25.tex +++ b/Doc/whatsnew/whatsnew25.tex @@ -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 |