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/045942.html below:

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

[Python-Dev] file() or open()? [Python-Dev] file() or open()?Guido van Rossum guido at python.org
Wed Jul 7 17:51:48 CEST 2004
> I presumed file() was preferred to open() for the simple reason that
> it says more explicitly what you are doing. You are constructing a
> file object. "open()" doesn't say whether you are opening a file or
> socket or window or folder or ...
> 
> open made sense in a Unix world where "everything was a file"
> (except that even then it wasn't really) but it is a poor name for
> the file opening function in a 21st century language.

Maybe you'll change your mind when open() can return other objects
besides files.  In the mean time, let's use the compatibility
argument.  Changing things just because a new century has started
sounds like a fad to me -- IOW the argument "it's the modern thing to
do" usually doesn't convince me.

--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