By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,587 Members | 1,667 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,587 IT Pros & Developers. It's quick & easy.

Question about python 2.4 documentation

P: n/a
Hello all.

I have a small question concerning the functions open(...) and file(...)
with python 2.4

In the online version of the documentation in the build-in functions
(section 2.1 http://docs.python.org/lib/built-in-funcs.html) here is an
quote of the file(...) doc :
The file() constructor is new in Python 2.2 and is an alias for open().
Both spellings are equivalent.
The intent is for open() to continue to be preferred for use as a factory function which
returns a new file object.
The spelling, file is more suited to type testing (for example, writing "isinstance(f, file)").

In my installed python 2.4 documentation the correspondig quote : The file() constructor is new in Python 2.2.
The previous spelling, open(), is retained for compatibility, and is an alias for file().


If I understand well, in my version it is recommended to use file()
function instead of open(), and in the online version it is the opposite.

what is the favorite function you recommend me to use ?
Thanks for your responses .
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Fouff wrote:
I have a small question concerning the functions open(...) and file(...)
with python 2.4
The intent is for open() to continue to be preferred for use as a factory
function which returns a new file object.
versus
The previous spelling, open(), is retained for compatibility, and is an
alias for file().

what is the favorite function you recommend me to use ?


The former has BDFL blessing. Let Guido speak:

http://mail.python.org/pipermail/pyt...ly/045921.html

Peter
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.