[Python-Dev] file() or open()? (original) (raw)
Aahz aahz at pythoncraft.com
Mon Jul 12 15:44:44 CEST 2004
- Previous message: [Python-Dev] Re: Re: file() or open()?
- Next message: [Python-Dev] file() or open()?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, Jul 10, 2004, Terry Reedy wrote:
In a previous post, Guido justified 'open' on the basis that applications 'open' 'files'. However, in every such application I can think of at the moment, 'open' means 'read the data and convert it to one of the application's internal native formats, even if it was written in a different format by another application. In other words, app.open(path) == file(path).read().convert(filetype(path)). Conversely, one never opens a file before saveing a fresh new document; one just saves-as. So Python's open() is quite different from the app usage of 'open'.
On the gripping hand, just about every programming language in the Algol
family uses open()
. And yes, I'm specifically including C/C++ and
Perl.
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"Typing is cheap. Thinking is expensive." --Roy Smith, c.l.py
- Previous message: [Python-Dev] Re: Re: file() or open()?
- Next message: [Python-Dev] file() or open()?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]