prePEP: Decimal data type

Aahz aahz at pythoncraft.com
Wed Nov 5 13:55:09 EST 2003


In article <bob8a4$1bmvct$1 at ID-11957.news.uni-berlin.de>,
Emile van Sebille <emile at fenx.com> wrote:
>
>The Context still needs to be defined, but Aahz says:
>> Context applies only to operations, not to Decimal instances;
>> changing the Context does not affect existing instances if
>> there are no operations on them.
>
>...from which I infer that Context exists in part to limit/round
>calculated results.  Even if it were possible for me, as a user of
>Decimal, to set Context appropriately to achieve these ends, what
>if I use a library that also changes Context?  The integrity of my
>calculations may be impacted.

That's correct.  There needs to be a social convention that libraries
intended for use by other people *CANNOT* muck with Context, and if they
do so for their own internal calculations, they must save and restore
Context.  You can probably find additional information about this in
Cowlishaw.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan




More information about the Python-list mailing list