Staging: this is not the live site, pydocs.org.
If file is a string, a path-like object or a bytes-like object open the file by that name, otherwise treat it as a file-like object. mode can be:
Changed in 3.4, 3.15
- 3.4: Added support for unseekable files.
- 3.15: Added support for path-like objects and bytes-like objects.