We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.


file(filename[, mode[, bufsize]])

The type used for file objects (see type-file).

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)”).