[Python-Dev] file() or open()? (original) (raw)
Guido van Rossum guido at python.org
Wed Jul 7 06:04:40 CEST 2004
- Previous message: [Python-Dev] file() or open()?
- Next message: [Python-Dev] Re: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.62, 1.63
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Then should the following line in the reference be changed?
"The file() constructor is new in Python 2.2. The previous spelling, open(), is retained for compatibility, and is an alias for file()." That strongly suggests that the preferred spelling is file(), and that open() shouldn't be used for new code.
Oops, yes. I didn't write that, and it doesn't convey my feelings about file() vs. open(). Here's a suggestion for better words:
"The file class is new in Python 2.2. It represents the type (class) of objects returned by the built-in open() function. Its constructor is an alias for open(), but for future and backwards compatibility, open() remains preferred."
--Guido van Rossum (home page: http://www.python.org/~guido/)
- Previous message: [Python-Dev] file() or open()?
- Next message: [Python-Dev] Re: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.62, 1.63
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]