RE: prePEP: Decimal data type

From: Tim Peters (tim.one_at_comcast.net)
Date: 11/06/03


Date: Thu, 6 Nov 2003 10:51:49 -0500
To: <python-list@python.org>


[Aahz]
> 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.

They have another choice, because Guido had a brilliant idea: the
arithmetic operations in Eric's implementation are methods *of* a context
object (because Guido suggested that). So a maximally robust library
doesn't *have* to change the thread context at all: it can create whatever
private context object(s) it needs, and spell arithmetic as explicit method
calls on its private context object(s), so that the default thread context
object is neither consulted nor modified. This is very robust, and in small
doses is quite bearable.



Relevant Pages

  • Accessing Debug Registers in Linux
    ... I want to understand software debugging in OSs. ... Debuggers in Windows uses Debug API + Thread Context Functions to do ...
    (comp.lang.asm.x86)
  • Re: About the NEITHER method to read and write data
    ... same process as the user mode caller. ... topmost drivers *ALWAYS* receive IOCTLs in context of threads ... that initiate them - if thread context eventually gets lost, ...
    (microsoft.public.development.device.drivers)
  • Re: prePEP: Decimal data type
    ... >> Context will still need to explicitly push and pop Context because ... > object (because Guido suggested that). ... > calls on its private context object, so that the default thread context ...
    (comp.lang.python)