diff options
author | Raymond Hettinger <python@rcn.com> | 2005-01-07 04:35:08 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2005-01-07 04:35:08 (GMT) |
commit | 105a2e236cc2348aee37138f9b00d1dedb2e33aa (patch) | |
tree | 3b96935c8e0b9ab5252f6ca86ef9b5b0441f600d /Doc | |
parent | 46cfa3988721f81dd8debef4ce59ce463252cba0 (diff) | |
download | cpython-105a2e236cc2348aee37138f9b00d1dedb2e33aa.zip cpython-105a2e236cc2348aee37138f9b00d1dedb2e33aa.tar.gz cpython-105a2e236cc2348aee37138f9b00d1dedb2e33aa.tar.bz2 |
SF patch 1094011: Docs for file() vs open().
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libfuncs.tex | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Doc/lib/libfuncs.tex b/Doc/lib/libfuncs.tex index 65e2548..3d185db 100644 --- a/Doc/lib/libfuncs.tex +++ b/Doc/lib/libfuncs.tex @@ -416,9 +416,12 @@ class C: after any I/O has been performed, and there's no reliable way to determine whether this is the case.} - The \function{file()} constructor is new in Python 2.2. The previous - spelling, \function{open()}, is retained for compatibility, and is an - alias for \function{file()}. + The \function{file()} constructor is new in Python 2.2 and is an + alias for \function{open()}. Both spellings are equivalent. The + intent is for \function{open()} to continue to be preferred for use + as a factory function which returns a new \class{file} object. The + spelling, \class{file} is more suited to type testing (for example, + writing \samp{isinstance(f, file)}). \end{funcdesc} \begin{funcdesc}{filter}{function, list} |