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