At 04:57 PM 5/16/2005 +1200, Greg Ewing wrote:
>Guido van Rossum wrote:
>
> >>Also, one question: will the "do protocol" be added to built-in "resource"
> >>types?  That is, locks, files, sockets, and so on?
> >
> > One person proposed that and it was shot down by Greg Ewing. I think
> > it's better to require a separate wrapper.
>
>It depends on whether the resource is "reusable".

Why?  If "with" is a "scope statement", then it doesn't make any sense to 
use it with something you intend to reuse later.  The statement itself is 
an assertion that you intend to "release" the resource at the end of the 
block, for whatever "release" means to that object.  Releasing a file is 
obviously closing it, while releasing a lock is obviously unlocking it.

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to