A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-May/053814.html below:

[Python-Dev] PEP 343 - Abstract Block Redux

[Python-Dev] PEP 343 - Abstract Block Redux [Python-Dev] PEP 343 - Abstract Block ReduxPhillip J. Eby pje at telecommunity.com
Mon May 16 19:25:06 CEST 2005
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.

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4