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?

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to