File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -416,9 +416,12 @@ \section{Built-in Functions \label{built-in-funcs}}
416416 after any I/O has been performed, and there's no reliable way to
417417 determine whether this is the case.}
418418
419- The \function {file()} constructor is new in Python 2.2. The previous
420- spelling, \function {open()}, is retained for compatibility, and is an
421- alias for \function {file()}.
419+ The \function {file()} constructor is new in Python 2.2 and is an
420+ alias for \function {open()}. Both spellings are equivalent. The
421+ intent is for \function {open()} to continue to be preferred for use
422+ as a factory function which returns a new \class {file} object. The
423+ spelling, \class {file} is more suited to type testing (for example,
424+ writing \samp {isinstance(f, file)}).
422425\end {funcdesc }
423426
424427\begin {funcdesc }{filter}{function, list}
You can’t perform that action at this time.
0 commit comments