A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-May/053856.html below:

[Python-Dev] Example for PEP 343

[Python-Dev] Example for PEP 343 [Python-Dev] Example for PEP 343Phillip J. Eby pje at telecommunity.com
Wed May 18 00:05:42 CEST 2005
At 02:42 PM 5/17/2005 -0700, Michael Chermside wrote:

># ===== SAMPLE #1: increasing precision during a sub-calculation =====
>
>import decimal
>
>@do_template
>def with_extra_precision(places=2):
>     "Performs nested computation with extra digits of precision."
>     decimal.getcontext().prec += 2
>     yield None
>     decimal.getcontext().prec -= 2

Won't this do the wrong thing if something within the block alters the 
precision?

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4