A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-July/045931.html below:

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

[Python-Dev] file() or open()?Guido van Rossum guido at python.org
Wed Jul 7 06:04:40 CEST 2004
> 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/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4