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
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
"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
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
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.
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
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
[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
_
[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
_
"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
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
> > 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
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
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
>
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
> "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
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
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
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 "
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.
> > 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 --
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
[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
23 matches
Mail list logo