From: R David Murray Date: Sat, 18 Aug 2012 00:40:03 +0000 (-0400) Subject: Merge #15694: reflow paragraph. X-Git-Tag: v3.3.0rc1~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed7fb9c74d291df0f97f42f2f99bf17498c2e6ae;p=python Merge #15694: reflow paragraph. --- ed7fb9c74d291df0f97f42f2f99bf17498c2e6ae diff --cc Doc/library/functions.rst index e063895428,b3238b154b..ddc946bb40 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@@ -903,20 -903,9 +903,19 @@@ are always available. They are listed closed. If a filename is given *closefd* has no effect and must be ``True`` (the default). + A custom opener can be used by passing a callable as *opener*. The underlying + file descriptor for the file object is then obtained by calling *opener* with + (*file*, *flags*). *opener* must return an open file descriptor (passing + :mod:`os.open` as *opener* results in functionality similar to passing + ``None``). + + .. versionchanged:: 3.3 + The *opener* parameter was added. + The ``'x'`` mode was added. + The type of :term:`file object` returned by the :func:`open` function - depends on the - mode. When :func:`open` is used to open a file in a text mode (``'w'``, - ``'r'``, ``'wt'``, ``'rt'``, etc.), it returns a subclass of + depends on the mode. When :func:`open` is used to open a file in a text + mode (``'w'``, ``'r'``, ``'wt'``, ``'rt'``, etc.), it returns a subclass of :class:`io.TextIOBase` (specifically :class:`io.TextIOWrapper`). When used to open a file in a binary mode with buffering, the returned class is a subclass of :class:`io.BufferedIOBase`. The exact class varies: in read