Re: [Python-Dev] PEP 343 and __context__()

2006-01-20 Thread Nick Coghlan
Jason Orendorff wrote: > On 1/20/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: >> Jason Orendorff wrote: >>> DecimalContext has a few problems. In code where it matters, every >>> function you write has to worry about it. (That is, you can't just >>> write __decimal_context__ = ... at the top of the

Re: [Python-Dev] PEP 343 and __context__()

2006-01-20 Thread Jason Orendorff
On 1/20/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Jason Orendorff wrote: > > DecimalContext has a few problems. In code where it matters, every > > function you write has to worry about it. (That is, you can't just > > write __decimal_context__ = ... at the top of the file and be done > > with

Re: [Python-Dev] PEP 343 and __context__()

2006-01-20 Thread Phillip J. Eby
At 07:21 PM 01/20/2006 +1000, Nick Coghlan wrote: >Yeah, it came up in response to PJE's suggestion of task-local variables for >generators. The basic concept we came up with is that if you're writing a >generator that uses a specific context, remember to save the original and >restore it around an

Re: [Python-Dev] PEP 343 and __context__()

2006-01-20 Thread Nick Coghlan
Jason Orendorff wrote: > I just noticed that my name is in PEP 343 attached to the idea of the > __context__() method, and I'm slightly queasy over it. > > The rationale was to help e.g. decimal.DecimalContext support 'with'. > Maybe that's a bad idea. > > DecimalContext has a few problems. In

[Python-Dev] PEP 343 and __context__()

2006-01-19 Thread Jason Orendorff
I just noticed that my name is in PEP 343 attached to the idea of the __context__() method, and I'm slightly queasy over it. The rationale was to help e.g. decimal.DecimalContext support 'with'. Maybe that's a bad idea. DecimalContext has a few problems. In code where it matters, every function