Re: [Python-Dev] Terminology for PEP 343

2005-08-12 Thread Christos Georgiou
Michael Hudson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Guard? Monitor? Don't really like either of these. I know I am late, but since guard means something else, 'sentinel' (in the line of __enter__ and __exit__ interpretation) could be an alternative. Tongue in cheek.

[Python-Dev] Terminology for PEP 343

2005-07-12 Thread Marc-Antoine Parent
Probably late in the game, esp. for an outsider, but I read the terminology discussion with interest. FWIW, I do like Philip's use of context, though I feel that it is a very generic word that may clash with many application-level classes... For that reason, I also liked scope a lot, though

Re: [Python-Dev] Terminology for PEP 343

2005-07-06 Thread Nick Coghlan
Michael Sparks wrote: On Monday 04 Jul 2005 03:10, Phillip J. Eby wrote: At 03:41 PM 7/3/2005 -0400, Raymond Hettinger wrote: [Michael Hudson] This is possible. I just wanted to expand everyone's minds :) The mechanism is more general than resourcemanagement. Expand your mind. :)

Re: [Python-Dev] Terminology for PEP 343

2005-07-05 Thread Greg Ewing
Phillip J. Eby wrote: At 11:48 PM 7/3/2005 -0400, Raymond Hettinger wrote: with context_expression as variable: # perform actions within a context The with statement establishes a context in which some operations are to be performed. I like this. The object produced by

Re: [Python-Dev] Terminology for PEP 343

2005-07-05 Thread Nick Coghlan
Raymond Hettinger wrote: With Statements and Suite Management This is nicely done :-) Nit: Replace e.g. with such as. BTW, do you support changing __exit__ to __leave__? I think it provides a small but useful gain in usability. I was initially -0 on the idea, and I've moved to a

Re: [Python-Dev] Terminology for PEP 343

2005-07-05 Thread Fred L. Drake, Jr.
On Tuesday 05 July 2005 02:57, Greg Ewing wrote: I'm thinking about something like context manager, or at least something with context in it. Oh, I like this one. Context manager / context protocol work well for me. -Fred -- Fred L. Drake, Jr. fdrake at acm.org

Re: [Python-Dev] Terminology for PEP 343

2005-07-04 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 is

Re: [Python-Dev] Terminology for PEP 343

2005-07-04 Thread Michael Hudson
Raymond Hettinger [EMAIL PROTECTED] writes: Another trouble with resource managed is that it makes little sense even when describing something that is clearly a resource (for instance, locking objects are resource managed, what the heck could that mean, there is no hint about the presence of

Re: [Python-Dev] Terminology for PEP 343

2005-07-04 Thread Ron Adam
Raymond Hettinger wrote: There is no value in expanding a concept to the point of being meaningless (i.e. meaning whatever you want it to or nothing at all). Instead, we need a phrase that expresses the essence of the following: abc = EXPR exc = (None, None, None)

Re: [Python-Dev] Terminology for PEP 343

2005-07-04 Thread Nick Coghlan
Take II on some draft docs (accuracy of specific examples obviously depends on other PEP 343 and PEP 342 related updates). Based on the various discussions, the following suggests the term suite managers. That focuses on the fact that we're doing something before and after the contained suite.

Re: [Python-Dev] Terminology for PEP 343

2005-07-04 Thread Phillip J. Eby
At 11:48 PM 7/3/2005 -0400, Raymond Hettinger wrote: Remember, these methods are going to show up in objects such as Context which are not primarily about 343. All of the other methods names will have nothing to do with 343, so our choice of magic names needs to be really good (as there will

Re: [Python-Dev] Terminology for PEP 343

2005-07-04 Thread Raymond Hettinger
[Phillip J. Eby] with context_expression as variable: # perform actions within a context The with statement establishes a context in which some operations are to be performed. Often, this is a resource management context, wherein some resource is allocated when the context is

Re: [Python-Dev] Terminology for PEP 343

2005-07-04 Thread Delaney, Timothy (Tim)
Phillip J. Eby wrote: Expand your mind. :) Resource can include whatever objects you want it to -- or no objects at all. A resource can be conceptual - like for example the user's attention, or the contents of a status bar or log message, or the timing/profiling of an activity. I think

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 contained

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 exit may be too

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 mean

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 just

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 direct as,

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Michael Walter
Hmm: Guarding a scope with a decimal.Context() object explain effect. 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] 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 the documentation?

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 think of (as

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 explain effect.

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Raymond Hettinger
Walter [mailto:[EMAIL PROTECTED] Sent: Sunday, July 03, 2005 10:28 PM To: Raymond Hettinger Cc: [EMAIL PROTECTED]; python-dev@python.org Subject: Re: [Python-Dev] Terminology for PEP 343 Hmm, I think I'm seeing mostly the (guarded) entry/exit part of guard metaphor, but I see what you mean

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 -- or no

Re: [Python-Dev] Terminology for PEP 343

2005-07-03 Thread Michael Walter
, July 03, 2005 10:28 PM To: Raymond Hettinger Cc: [EMAIL PROTECTED]; python-dev@python.org Subject: Re: [Python-Dev] Terminology for PEP 343 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

Re: [Python-Dev] Terminology for PEP 343

2005-07-02 Thread Jeff Rush
On Friday 01 July 2005 10:45 am, Fred L. Drake, Jr. wrote: On Friday 01 July 2005 11:44, Phillip J. Eby wrote: Resource managers. Yeah, I was thinking that, but was somewhat ambivalent. But I definately like it better than anything else proposed so far. I like that as well. My hat in the

Re: [Python-Dev] Terminology for PEP 343

2005-07-02 Thread Ron Adam
Raymond Hettinger wrote: Hmm, that got me to thinking a bit more. Here's another subjective two cents worth. exit seems to be a more global concept and leave seems more local. For instance, I leave a room but exit a building. In Python, sys.exit and os._exit are grand exits rather than

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Eric Nieuwland
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? Witty objects? ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Nick Coghlan
Raymond Hettinger wrote: Whatever term is selected, it should be well thought-out and added to the glossary. The choice of words will likely have a great effect on learnability and on how people think about the new tool. When writing PEP 346, I ended up choosing user defined statement as a

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Mark Russell
On Thu, 2005-06-30 at 22:41, 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? Their raison d'etre is to bracket user code with setup and teardown methods, so how about the

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Phillip J. Eby
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. ___ Python-Dev mailing list

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Brett Cannon
On 7/1/05, Fred L. Drake, Jr. [EMAIL PROTECTED] wrote: On Friday 01 July 2005 11:44, Phillip J. Eby wrote: Resource managers. Yeah, I was thinking that, but was somewhat ambivalent. But I definately like it better than anything else proposed so far. I say we steal from the C++ and the

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Raymond Hettinger
[Brett Cannon] I say we steal from the C++ and the RAII paradigm and go with RMUW (Resource Management Using 'with' Or the-keyword-formerly-known-as-do Raymond ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Ron Adam
Nick Coghlan wrote: Raymond Hettinger wrote: Whatever term is selected, it should be well thought-out and added to the glossary. The choice of words will likely have a great effect on learnability and on how people think about the new tool. I tried to bring this up on python-list, but I

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Raymond Hettinger
[Raymond] Whatever term is selected, it should be well thought-out and added to the glossary. The choice of words will likely have a great effect on learnability and on how people think about the new tool. [Ron Adam] I tried to bring this up on python-list, but I didn't get much of a

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Michael Chermside
Raymond writes: On a separate note, I also propose that __exit__() be renamed to __leave__(). The enter/leave word pairing are a better fit in standard English: I don't feel strongly about it, but I tend to disagree. Certainly you will admit that enter-exit IS a gramatically correct pairing

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Raymond Hettinger
I would use She left the ballpark. for someone walking into the dugout, climbing up into the stands, or walking out of the stadium, and might refer to the entire process. Using She exited the ballpark. to me suggests the exact moment that she went through the door dividing outside from

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Nick Coghlan
Michael Chermside wrote: In favor of exit over leave I have only two arguments. First, I just like exit better. Hmm... didn't find that compelling? I was afraid of that. I have a pretty simple reason for liking the enter/exit pair over the enter/leave pair. In the former case, both words

Re: [Python-Dev] Terminology for PEP 343

2005-07-01 Thread Ron Adam
Raymond Hettinger wrote: On a separate note, I also propose that __exit__() be renamed to __leave__(). The enter/leave word pairing are a better fit in standard English: I tend to associate leave with leaving, and leaving with arriving. I didn't even think the __enter__ / __exit__ names

[Python-Dev] Terminology for PEP 343

2005-06-30 Thread Raymond Hettinger
With 343 accepted, we can now add __enter__() and __exit__() methods to objects. What term should describe those objects in the documentation? For instance, if the new magic methods are added to decimal.Context(), do we then describe Context objects as withable ;-) The PEP itself doesn't

Re: [Python-Dev] Terminology for PEP 343

2005-06-30 Thread Michael Hudson
Raymond Hettinger [EMAIL PROTECTED] writes: With 343 accepted, we can now add __enter__() and __exit__() methods to objects. What term should describe those objects in the documentation? Hmm, don't know. I talked about an object 'that conformed to the with protocol' at EuroPython, which

Re: [Python-Dev] Terminology for PEP 343

2005-06-30 Thread Brett Cannon
Resource managed? On 6/30/05, Raymond Hettinger [EMAIL PROTECTED] wrote: With 343 accepted, we can now add __enter__() and __exit__() methods to objects. What term should describe those objects in the documentation? For instance, if the new magic methods are added to decimal.Context(),