[Python-Dev] PEP 343 - Abstract Block Redux

Greg Ewing greg.ewing at canterbury.ac.nz
Mon May 16 06:57:19 CEST 2005


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". It
would be okay for locks since you can lock and unlock
the same lock as many times as you want, but files
and sockets can only be used once, so there has to
be something else around them.

ALthough if we use 'do', we might want to use wrappers
anyway for readability, even if they're not semantically
necessary.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+


More information about the Python-Dev mailing list