469,936 Members | 2,463 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,936 developers. It's quick & easy.

Question about python 2.4 documentation

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
1 1354
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.

Similar topics

4 posts views Thread by Jeffrey Borkent | last post: by
65 posts views Thread by Steven Watanabe | last post: by
26 posts views Thread by Kevin Walzer | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.