Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Nick Coghlan
Ron Adam wrote: > So it could be a "Resource Manager Block", which > uses a "__begin__" and "__end__" method, which is defined in a "Resource > Manger" object or a "Resource Manager Generator" object, which is called > by the 'with' key word. Here's an initial crack at an equivalent of the curr

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Aahz
On Sun, Jul 03, 2005, Nick Coghlan wrote: > > [...] > Anyway, I stuck with 'exit' for this - I prefer slightly awkard > phrasing in the explanation to awkwardness in the pairing of the names. > > [...] >__exit__(exc_type, exc_value, exc_traceback): > Called as execution exits the con

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Michael Hudson
"Phillip J. Eby" <[EMAIL PROTECTED]> writes: > At 05:41 PM 6/30/2005 -0400, Raymond Hettinger wrote: >>With 343 accepted, we can now add __enter__() and __exit__() methods to >>objects. >> >>What term should describe those objects in the documentation? > > Resource managers. Thing is, there may b

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Josiah Carlson
Just because not all cars are used as vehicles, does that mean that cars are not vehicles? There may be cases where the object being managed is not a resource per-se, but that doesn't mean that the mechanism is misnamed as a 'resource manager'; it's just the most common use case that any of us ha

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Ron Adam
Nick Coghlan wrote: > On the other hand 'enter and exit' rolls off the tongue > significantly better than 'enter and leave' My only concern is enter and exit may be too general. They are frequently used in other places, although __enter__ and __exit__ are less common, so maybe it's a non issue.

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Michael Walter
How about simply "with block" or "guarded scope" or something like that? Michael On 7/3/05, Ron Adam <[EMAIL PROTECTED]> wrote: > Nick Coghlan wrote: > > > On the other hand 'enter and exit' rolls off the tongue > > significantly better than 'enter and leave' > > My only concern is enter and ex

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-07-03 Thread Guido van Rossum
On 6/30/05, Neil Hodgson <[EMAIL PROTECTED]> wrote: >One benefit I see for the path module is that it makes it easier to > write code that behaves correctly with unicode paths on Windows. > Currently, to implement code that may see unicode paths, you must > first understand that unicode paths m

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
[Michael Walter] > How about simply "with block" or "guarded scope" or something like that? How would you use that to describe decimal.Context() objects after Nick adds the __enter__ and __exit__ magic methods? We want something as direct as, "xrange objects are iterable". Raymond _

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
[Ron Adam] > The terms __begin__ and __end__, are nearly as general, but they stress > better that there are three parts, a beginning, middle and ending. -1 Those are too generic to communicate anything. You would be better off using beginwith and endwith or somesuch. Raymond _

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Terry Reedy
"Michael Hudson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thing is, there may be no resource; in my talk at EuroPython: > >http://starship.python.net/crew/mwh/recexc.pdf > > I used a with statement to establish and dis-establish an error > handler -- would you call that a

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Michael Hudson
On 3 Jul 2005, at 18:25, Josiah Carlson wrote: > Just because not all cars are used as vehicles, does that mean that > cars > are not vehicles? No, but it means calling all vehicles "cars" is dumb. > There may be cases where the object being managed is not a resource > per-se, but that doesn't

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
> > There may be cases where the object being managed is not a resource > > per-se, but that doesn't mean that the mechanism is misnamed as a > > 'resource manager'; it's just the most common use case that any of us > > have managed to think of (as of yet). [Michael Hudson] > This is possible. I

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Aahz
On Sun, Jul 03, 2005, Raymond Hettinger wrote: > [Michael Walter] >> >> How about simply "with block" or "guarded scope" or something like >> that? > > How would you use that to describe decimal.Context() objects after > Nick adds the __enter__ and __exit__ magic methods? We want something > as d

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Michael Walter
Hmm: "Guarding a scope with a decimal.Context() object ." What do you think? (I'm not sure myself, but we even got a "with" in there :-) Michael On 7/3/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > [Michael Walter] > > How about simply "with block" or "guarded scope" or something like >

Re: [Python-Dev] Adding the 'path' module (was Re: Some RFE for review)

2005-07-03 Thread Neil Hodgson
Guido van Rossum: > Then maybe the code that handles Unicode paths in arguments should be > fixed rather than adding a module that encapsulates a work-around... It isn't clear whether you are saying this should be fixed by the user or in the library. For a quick example, say someone wrote some

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
> "Guarding a scope with a decimal.Context() object ." Doesn't "guard" suggestion conditional execution? Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Phillip J. Eby
At 03:04 PM 7/3/2005 +0100, Michael Hudson wrote: >"Phillip J. Eby" <[EMAIL PROTECTED]> writes: > > > At 05:41 PM 6/30/2005 -0400, Raymond Hettinger wrote: > >>With 343 accepted, we can now add __enter__() and __exit__() methods to > >>objects. > >> > >>What term should describe those objects in th

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Phillip J. Eby
At 03:41 PM 7/3/2005 -0400, Raymond Hettinger wrote: > > > There may be cases where the object being managed is not a resource > > > per-se, but that doesn't mean that the mechanism is misnamed as a > > > 'resource manager'; it's just the most common use case that any of >us > > > have managed to t

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Michael Walter
Hmm, I think I'm seeing mostly the (guarded) entry/exit part of "guard" metaphor, but I see what you mean (not allowing "entry", so to say, right?). Not sure. Michael On 7/3/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > "Guarding a scope with a decimal.Context() object ." > > Doesn't "

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
I'm referring to the specific meaning of "guard" in a computer science context: http://www.computer-dictionary-online.org/guard.htm?q=guard >From David Gries, The Science of Programming, if statement contains two entities of the form B --> S wehere B is a Boolean expression and S a command.

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
> > The mechanism is more general than resource > >management. Like decorators, the encapsulation of a try/finally wrapper > >is completely generic and not married to the resource management > >context. [Phillip] > Expand your mind. :) "Resource" can include whatever objects you want it > to --

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Michael Walter
Oh, I remember. Agreed, it is most probably a bad choice then. One part of my brain likes: "By wrapping a block in/with[*] a decimal.Context, " "xml.Tags used to wrap a block will print '' before the block is entered, and '' after execution has left." What do you think? [*] I'm not sure wha

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
[Aahz] > How about "decimal.Context() objects are managed resources" or "...have > guarded scopes"? (I'm not terribly wild about either, but they are > fairly simple and direct.) See my other posts which bag on both "managed resources" and "guarded". The part about scopes is less clear -- there i