First page Back Continue Last page Overview Text

Notes:


The decimal module also creates a per-thread context object. This controls a several things: the number of digits of precision, the rounding rules, whether to throw exceptions or “raise flags”. It provide a place to go to see if the flags have been raised. There are a few other things also.
The per-thread instance can be accessed by decimal.getcontext(), or a context object can be supplied along with most decimal operations. The context is per thread so that different libraries can avoid interfering with each other.
The context object is really needed only for some pretty advanced things. Normally, just ignore it.