prePEP: Decimal data type

Aahz aahz at pythoncraft.com
Thu Nov 6 10:18:52 EST 2003


In article <mailman.475.1068074773.702.python-list at python.org>,
Jp Calderone  <exarkun at intarweb.us> wrote:
>On Wed, Nov 05, 2003 at 01:55:09PM -0500, Aahz wrote:
>> In article <bob8a4$1bmvct$1 at ID-11957.news.uni-berlin.de>,
>> Emile van Sebille <emile at fenx.com> wrote:
>>>
>>>...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.
>
>  Enter the context stack.

Well, sure.  And it won't be hard to add given that Decimal will already
need to track thread-specific Context.  But modules changing Context
will still need to explicitly push and pop Context because usually you
will just want to replace the current Context.
-- 
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