Re: [Python-Dev] With context, please

2006-04-23 Thread Paul Moore
On 4/23/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > - contextlib.contextmanager() > - is actually used to define contexts according to the current docs > - but returns a GeneratorContextManager object You may just be trying to avoid overcomplicating things by adding too much detail

Re: [Python-Dev] With context, please

2006-04-23 Thread Nick Coghlan
Phillip J. Eby wrote: > Read the first sentence again: > > "EXPRESSION returns a value that the with statement uses to *create* a > context" (emphasis added). > > It doesn't say that the value *is* the context, and if anything, the > second excerpt supports that by implying that the context man

Re: [Python-Dev] With context, please

2006-04-22 Thread Phillip J. Eby
At 01:33 PM 4/23/2006 +1000, Nick Coghlan wrote: >Phillip J. Eby wrote: >>At 09:25 AM 4/22/2006 -0700, Aahz wrote: >>> EXPRESSION returns a value that the with statement uses to create a >>> context (a special kind of namespace). The context is used to >>> execute the BLOCK. The block

Re: [Python-Dev] With context, please

2006-04-22 Thread Nick Coghlan
Phillip J. Eby wrote: > At 09:25 AM 4/22/2006 -0700, Aahz wrote: >> EXPRESSION returns a value that the with statement uses to create a >> context (a special kind of namespace). The context is used to >> execute the BLOCK. The block might end normally, get terminated by >> a break

Re: [Python-Dev] With context, please

2006-04-22 Thread Phillip J. Eby
At 09:25 AM 4/22/2006 -0700, Aahz wrote: > EXPRESSION returns a value that the with statement uses to create a > context (a special kind of namespace). The context is used to > execute the BLOCK. The block might end normally, get terminated by > a break or return, or raise an exce

Re: [Python-Dev] With context, please

2006-04-22 Thread Aahz
On Sat, Apr 22, 2006, Phillip J. Eby wrote: > At 09:05 AM 4/22/2006 -0700, Aahz wrote: >> >>I've been following the with/context discussion, not that closely, but >>reading all the posts. I also have to write docs on this for Python for >>Dummies, which I think is going to be the first book out af

Re: [Python-Dev] With context, please

2006-04-22 Thread Phillip J. Eby
At 09:05 AM 4/22/2006 -0700, Aahz wrote: >I've been following the with/context discussion, not that closely, but >reading all the posts. I also have to write docs on this for Python for >Dummies, which I think is going to be the first book out after 2.5. So >far, my take is that I want the block

[Python-Dev] With context, please

2006-04-22 Thread Aahz
I've been following the with/context discussion, not that closely, but reading all the posts. I also have to write docs on this for Python for Dummies, which I think is going to be the first book out after 2.5. So far, my take is that I want the block of code to be executed in a context. I'm pro