[Python-Dev] Re: file() or open()?

Bob Ippolito bob at redivi.com
Wed Jul 7 22:51:09 CEST 2004


n Jul 7, 2004, at 4:46 PM, orbitz wrote:

> Terry Reedy wrote:
>
>> "François Pinard" <pinard at iro.umontreal.ca> wrote in message
>> news:20040707183033.GA30577 at alcyon.progiciels-bpi.ca...
>>
>>> I perceived the introduction of `file()' as a nice cleanup in Python.
>>
>> As a user, so did I.  I like the cosistency of using file along with 
>> int,
>> tuple, list, dict, type, (and did I leave out something), and all user
>> classes as constructors of instances of themselves.
> I considered more as the action being performed.  I'm opening 
> something, in this case a file.  And now I have an object which has 
> been opened, I can perform operations on it, and when I'm done I close 
> it.

But you also open sockets, pipes, applications, bank accounts, etc.  
"open" seems seriously ambiguous to me, and it's not a "generic" 
function like len or iter.  The only good reason I see is to associate 
"open" with files is because that's just how it's always been done in 
Python and C.

-bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-dev/attachments/20040707/6c5022c0/smime.bin


More information about the Python-Dev mailing list