diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-15 09:58:26 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-15 09:58:26 (GMT) |
commit | 0b65b0fc83fcef781443b505c8a24fa5ffe684c5 (patch) | |
tree | 67b7cedc57057576f3d83b9418bc88a628572491 /Doc/glossary.rst | |
parent | 5aa0d1056047ffbca76e8c2a1d27dcefd3716aeb (diff) | |
download | cpython-0b65b0fc83fcef781443b505c8a24fa5ffe684c5.zip cpython-0b65b0fc83fcef781443b505c8a24fa5ffe684c5.tar.gz cpython-0b65b0fc83fcef781443b505c8a24fa5ffe684c5.tar.bz2 |
Add a glossary entry for file objects.
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r-- | Doc/glossary.rst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 8a36939..5374e73 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -184,6 +184,23 @@ Glossary A module written in C or C++, using Python's C API to interact with the core and with user code. + file object + An object exposing a file-oriented API (with methods such as + :meth:`read()` or :meth:`write()`) to an underlying resource. + Depending on the way it was created, a file object can mediate access + to a real on-disk file or to another other type of storage or + communication device (for example standard input/output, in-memory + buffers, sockets, pipes, etc.). File objects are also called + :dfn:`file-like objects` or :dfn:`streams`. + + There are actually three categories of file objects: raw binary + files, buffered binary files and text files. Their interfaces are + defined in the :mod:`io` module. The canonical way to create a + file object is by using the :func:`open` function. + + file-like object + A synonym for :term:`file object`. + finder An object that tries to find the :term:`loader` for a module. It must implement a method named :meth:`find_module`. See :pep:`302` for |