Question about python 2.4 documentation

F

Fouff

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 .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top