Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-25 Thread Phillip J. Eby
At 04:31 PM 4/25/2006 -0700, Aahz wrote: >Right -- I've already been chastised for that. Unless someone has a >better idea, I'm going to call it a "wrapper". Better idea: just delete the parenthetical about a namespace and leave the rest of your text alone, at least until the dust settles. I th

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-25 Thread Aahz
On Tue, Apr 25, 2006, Guido van Rossum wrote: > On 4/24/06, Aahz <[EMAIL PROTECTED]> wrote: >> >> Let's go back to a pseudo-coded with statement: >> >> with EXPRESSION [as NAME]: >> BLOCK >> >> What happens while BLOCK is being executed? Again, here's what I said >> originally: >> >>

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-25 Thread Guido van Rossum
On 4/24/06, Aahz <[EMAIL PROTECTED]> wrote: > Let's go back to a pseudo-coded with statement: > > with EXPRESSION [as NAME]: > BLOCK > > What happens while BLOCK is being executed? Again, here's what I said > originally: > > EXPRESSION returns a value that the with statement uses t

[Python-Dev] PEP 343 update (with statement context terminology)

2006-04-25 Thread Jim Jewett
> So things like decimal.Context get left trying to find a sane > name for what their __context__ method returns. > decimal.Context.__context__() returns a . . . context? What? > Wasn't it already a context? Oh, so it actually returns a > "with statement context object". [I was OK with "context sp

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-25 Thread Nick Coghlan
Phillip J. Eby wrote: > If qualification of "context" is the only problem, I propose: > > context manager -- thing with __context__ method > execution context object -- thing with __enter__/__exit__/__context__ > execution context -- the abstract thing set up and torn down by the ECO > > "When re

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-25 Thread Phillip J. Eby
At 07:24 PM 4/25/2006 +1000, Nick Coghlan wrote: >So things like decimal.Context get left trying to find a sane name for what >their __context__ method returns. decimal.Context.__context__() returns a . . >. context? What? Wasn't it already a context? Oh, so it actually returns a >"with statement c

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-25 Thread Nick Coghlan
Paul Moore wrote: > On 4/25/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > I still found the alpha 1 terminology and documentation completely > natural and intuitive. Completely. Not "acceptable", but "completely > natural". From the perspective of someone with limited understanding > of the design,

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-25 Thread Paul Moore
On 4/25/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > PEP 343 made a *deliberate, conscious design decision* to copy the semantics > of iterators by making the context management protocol a superset of the > context protocol (or rather, the context specification protocol in alpha 2). OK. It's poss

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Nick Coghlan
Phillip J. Eby wrote: > At 04:48 AM 4/25/2006 +1000, Nick Coghlan wrote: >> Wanting to have two names for the same function tells me there's a >> problem >> with the terminology, not that we should actually have two names for >> the same >> function :) > > It is purely an implementation detail o

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Nick Coghlan
Phillip J. Eby wrote: > At 12:24 PM 4/24/2006 -0700, Aahz wrote: >> On Mon, Apr 24, 2006, Phillip J. Eby wrote: >>> At 04:48 AM 4/25/2006 +1000, Nick Coghlan wrote: Using two names to describe three different things isn't intuitive for anybody. >>> Um, what three things? I only count two

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Nick Coghlan
Paul Moore wrote: > In the documentation of contextmanager, consider the examples: > > @contextmanager > def tag(name): > ... > > class Tag: > ... > @contextmanager > def __context__(self): > ... > > Now, tag should be a function which retu

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Phillip J. Eby
At 04:48 AM 4/25/2006 +1000, Nick Coghlan wrote: >Wanting to have two names for the same function tells me there's a problem >with the terminology, not that we should actually have two names for the same >function :) It is purely an implementation detail of @contextmanager that it can be used to

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Phillip J. Eby
At 01:19 PM 4/24/2006 -0700, Aahz wrote: >What is EXPRESSION, then? Not the value it returns, but EXPRESSION >itself -- does it have a name? What about the kinds of things we use >for EXPRESSION? I read "EXPRESSION returns a value" as simply meaning that "value = EXPRESSION", i.e. that the resu

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Paul Moore
On 4/24/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Paul Moore wrote: > > I've proposed splitting it into > > two, but that seems not to suit you (you've never responded to it > > specifically, so I may be misreading your silence here). > > Wanting to have two names for the same function tells me

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Aahz
On Mon, Apr 24, 2006, Phillip J. Eby wrote: > At 12:49 PM 4/24/2006 -0700, Aahz wrote: >>On Mon, Apr 24, 2006, Phillip J. Eby wrote: >>> At 12:24 PM 4/24/2006 -0700, Aahz wrote: On Mon, Apr 24, 2006, Phillip J. Eby wrote: > At 04:48 AM 4/25/2006 +1000, Nick Coghlan wrote: >> >>Using

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Phillip J. Eby
At 12:49 PM 4/24/2006 -0700, Aahz wrote: >On Mon, Apr 24, 2006, Phillip J. Eby wrote: > > At 12:24 PM 4/24/2006 -0700, Aahz wrote: > >>On Mon, Apr 24, 2006, Phillip J. Eby wrote: > >>> At 04:48 AM 4/25/2006 +1000, Nick Coghlan wrote: > > Using two names to describe three different things i

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Aahz
On Mon, Apr 24, 2006, Phillip J. Eby wrote: > At 12:24 PM 4/24/2006 -0700, Aahz wrote: >>On Mon, Apr 24, 2006, Phillip J. Eby wrote: >>> At 04:48 AM 4/25/2006 +1000, Nick Coghlan wrote: Using two names to describe three different things isn't intuitive for anybody. >>> >>> Um, what thr

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Phillip J. Eby
At 12:24 PM 4/24/2006 -0700, Aahz wrote: >On Mon, Apr 24, 2006, Phillip J. Eby wrote: > > At 04:48 AM 4/25/2006 +1000, Nick Coghlan wrote: > >> > >>Using two names to describe three different things isn't intuitive for > >>anybody. > > > > Um, what three things? I only count two: > > > > 1. Object

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Aahz
On Mon, Apr 24, 2006, Phillip J. Eby wrote: > At 04:48 AM 4/25/2006 +1000, Nick Coghlan wrote: >> >>Using two names to describe three different things isn't intuitive for >>anybody. > > Um, what three things? I only count two: > > 1. Objects with __context__ > 2. Objects with __enter__ and __ex

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Phillip J. Eby
At 04:48 AM 4/25/2006 +1000, Nick Coghlan wrote: >Using two names to describe three different things isn't intuitive for >anybody. Um, what three things? I only count two: 1. Objects with __context__ 2. Objects with __enter__ and __exit__ What's the third thing? __

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Nick Coghlan
Paul Moore wrote: > 2. Nick, what can we do to persuade you to go back to the a1 version, > and simply look at @contextmanager? Using two names to describe three different things isn't intuitive for anybody. You might persuade me to change the names around, but you aren't going to persuade me to

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Paul Moore
On 4/24/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > At 10:26 AM 4/24/2006 +0100, Paul Moore wrote: > >OK. At this point, the discussion seems to have mutated from a > >"Phillip vs Nick" debate to a "Paul vs Nick" debate. > > I only stepped aside so that other people would chime in. I still don

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Phillip J. Eby
At 10:26 AM 4/24/2006 +0100, Paul Moore wrote: >OK. At this point, the discussion seems to have mutated from a >"Phillip vs Nick" debate to a "Paul vs Nick" debate. I only stepped aside so that other people would chime in. I still don't think the new terminology makes anything clearer, and would

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Paul Moore
On 4/24/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > > I think I've now read enough on the subject that my value as an > > unbiased reader is being lost... > > Your input really helped me figure out where the problem was, though. Trying > to describe 3 different things using only 2 distinct terms

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Nick Coghlan
Paul Moore wrote: > Right. I'll still do as I promised, and have a better look through the > latest documentation, but my gut feel is that this whole thing is > getting way out of proportion. Naming and terminology is important, > but we've now on our 3rd version of the docuentation. Only the 2nd,

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Paul Moore
On 4/24/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: [...] > The __iter__ method isn't called __iterator__, so why would the __context__ > method need to be called "__contextmgr__"? Because. Hmm, Oleg already responded to this, and to be honest, I think the whole issue is a nitpick. Apologi

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-24 Thread Oleg Broytmann
On Mon, Apr 24, 2006 at 12:44:09PM +1000, Nick Coghlan wrote: > Paul Moore wrote: > > - Surely the __context__ method should be called __contextmgr__ now > > that it's producing a context manager? (Same naming issue, just the > > other side of it...) > > The __iter__ method isn't called __iterator

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-23 Thread Nick Coghlan
Paul Moore wrote: >> Aside from the What's New document, this has now been done. My modifications >> consisted of terminology changes in the contextlib docs and the language >> reference to match the 2.5a1 implementation, a Context Types addition to the >> library reference similar to that for Iter

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-23 Thread Paul Moore
> Aside from the What's New document, this has now been done. My modifications > consisted of terminology changes in the contextlib docs and the language > reference to match the 2.5a1 implementation, a Context Types addition to the > library reference similar to that for Iterator Types, and a very

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-23 Thread Nick Coghlan
Nick Coghlan wrote: > For those not following along at home, I've now updated PEP 343 to clarify my > originally intended meanings for various terms, and to record the fact that > we > don't currently have a consensus on python-dev that those are the right > definitions. > > As written up in t

Re: [Python-Dev] PEP 343 update (with statement context terminology)

2006-04-23 Thread Nick Coghlan
Paul Moore wrote: > On 4/23/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: >> For those not following along at home, I've now updated PEP 343 to clarify my >> originally intended meanings for various terms, and to record the fact that >> we >> don't currently have a consensus on python-dev that those

[Python-Dev] PEP 343 update (with statement context terminology)

2006-04-22 Thread Nick Coghlan
For those not following along at home, I've now updated PEP 343 to clarify my originally intended meanings for various terms, and to record the fact that we don't currently have a consensus on python-dev that those are the right definitions. As written up in the PEP, I plan to propagate those i