summaryrefslogtreecommitdiffstats
path: root/Doc/glossary.rst
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-12-05 22:46:32 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-12-05 22:46:32 (GMT)
commitdd799d2e321d70db2c31403b5c919266575e12d1 (patch)
tree34e8767e14dcbd1656838d304753a8f96803e0e7 /Doc/glossary.rst
parent9c72ebc96be44c4ff66832cbe5e131065ae9d95d (diff)
downloadcpython-dd799d2e321d70db2c31403b5c919266575e12d1.zip
cpython-dd799d2e321d70db2c31403b5c919266575e12d1.tar.gz
cpython-dd799d2e321d70db2c31403b5c919266575e12d1.tar.bz2
Issue #18840: Introduce the json module in the tutorial, and deemphasize the pickle module.
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r--Doc/glossary.rst24
1 files changed, 20 insertions, 4 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index 71e4686..2347828 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -78,6 +78,13 @@ Glossary
Benevolent Dictator For Life, a.k.a. `Guido van Rossum
<http://www.python.org/~guido/>`_, Python's creator.
+ binary file
+ A :term:`file object` able to read and write
+ :term:`bytes-like objects <bytes-like object>`.
+
+ .. seealso::
+ A :term:`text file` reads and writes :class:`str` objects.
+
bytes-like object
An object that supports the :ref:`bufferobjects`, like :class:`bytes`,
:class:`bytearray` or :class:`memoryview`. Bytes-like objects can
@@ -225,10 +232,11 @@ Glossary
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.
+ There are actually three categories of file objects: raw
+ :term:`binary files <binary file>`, buffered
+ :term:`binary files <binary file>` and :term:`text files <text file>`.
+ 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`.
@@ -780,6 +788,14 @@ Glossary
:meth:`~collections.somenamedtuple._asdict`. Examples of struct sequences
include :data:`sys.float_info` and the return value of :func:`os.stat`.
+ text file
+ A :term:`file object` able to read and write :class:`str` objects.
+ Often, a text file actually accesses a byte-oriented datastream
+ and handles the text encoding automatically.
+
+ .. seealso::
+ A :term:`binary file` reads and write :class:`bytes` objects.
+
triple-quoted string
A string which is bound by three instances of either a quotation mark
(") or an apostrophe ('). While they don't provide any functionality