[Python-Dev] PEP 327: Decimal Data Type

Andrew P. Lentvorski, Jr. bsder at allcaps.org
Mon Feb 2 20:46:00 EST 2004


On Mon, 2 Feb 2004, Michael Chermside wrote:

> It would be a major pain if every time I called that library code
> it changed the context.

That would be badly behaved library code.

One thing that might be an issue is that context stacks tend to be real
headaches in threaded code.  The context stack must unwind in the "pushed"
order even though the "completion" order may be very different.  Such a
stack would make the ordering of calls to the Decimal module subject to
strange errors.

Another thing that might come up is that a context could be a
microprocessor resource.  Fully restoring such a resource can often be
very expensive and may not even be possible.

-a



More information about the Python-Dev mailing list