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

Guido van Rossum wrote:
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. Tim Delaney

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/)
participants (2)
-
Delaney, Timothy C (Timothy)
-
Guido van Rossum