summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMatthias Bussonnier <mbussonnier@ucmerced.edu>2019-05-20 20:44:11 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2019-05-20 20:44:11 (GMT)
commit1a3faf9d9740a8c7505c61839ef09929a7ff9e35 (patch)
treebdd3def7859b69fa221e5350842801dd381fdf5c /Doc
parent4011d865d0572a3dd9988f2935cd835cc8fb792a (diff)
downloadcpython-1a3faf9d9740a8c7505c61839ef09929a7ff9e35.zip
cpython-1a3faf9d9740a8c7505c61839ef09929a7ff9e35.tar.gz
cpython-1a3faf9d9740a8c7505c61839ef09929a7ff9e35.tar.bz2
bpo-36952: Remove the bufsize parameter in fileinput.input(). (GH-13400)
This parameter is marked as deprecated since 3.6 and for removal in 3.8. It already had no effects.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/fileinput.rst17
-rw-r--r--Doc/whatsnew/3.8.rst4
2 files changed, 14 insertions, 7 deletions
diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst
index af9dff3..14be492 100644
--- a/Doc/library/fileinput.rst
+++ b/Doc/library/fileinput.rst
@@ -54,7 +54,7 @@ provided by this module.
The following function is the primary interface of this module:
-.. function:: input(files=None, inplace=False, backup='', bufsize=0, mode='r', openhook=None)
+.. function:: input(files=None, inplace=False, backup='', *, mode='r', openhook=None)
Create an instance of the :class:`FileInput` class. The instance will be used
as global state for the functions of this module, and is also returned to use
@@ -72,8 +72,9 @@ The following function is the primary interface of this module:
.. versionchanged:: 3.2
Can be used as a context manager.
- .. deprecated-removed:: 3.6 3.8
- The *bufsize* parameter.
+ .. versionchanged:: 3.8
+ The keyword parameters *mode* and *openhook* are now keyword-only.
+
The following functions use the global state created by :func:`fileinput.input`;
if there is no active state, :exc:`RuntimeError` is raised.
@@ -135,7 +136,7 @@ The class which implements the sequence behavior provided by the module is
available for subclassing as well:
-.. class:: FileInput(files=None, inplace=False, backup='', bufsize=0, mode='r', openhook=None)
+.. class:: FileInput(files=None, inplace=False, backup='', *, mode='r', openhook=None)
Class :class:`FileInput` is the implementation; its methods :meth:`filename`,
:meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`,
@@ -160,18 +161,20 @@ available for subclassing as well:
with FileInput(files=('spam.txt', 'eggs.txt')) as input:
process(input)
+
.. versionchanged:: 3.2
Can be used as a context manager.
.. deprecated:: 3.4
The ``'rU'`` and ``'U'`` modes.
- .. deprecated-removed:: 3.6 3.8
- The *bufsize* parameter.
-
.. deprecated:: 3.8
Support for :meth:`__getitem__` method is deprecated.
+ .. versionchanged:: 3.8
+ The keyword parameter *mode* and *openhook* are now keyword-only.
+
+
**Optional in-place filtering:** if the keyword argument ``inplace=True`` is
passed to :func:`fileinput.input` or to the :class:`FileInput` constructor, the
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index 0a79b6c..5f8208d 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -828,6 +828,10 @@ The following features and APIs have been removed from Python 3.8:
exposed to the user.
(Contributed by Aviv Palivoda in :issue:`30262`.)
+* The ``bufsize`` keyword argument of :func:`fileinput.input` and
+ :func:`fileinput.FileInput` which was ignored and deprecated since Python 3.6
+ has been removed. :issue:`36952` (Contributed by Matthias Bussonnier)
+
Porting to Python 3.8
=====================