Skip to content

Commit aca273e

Browse files
mangrisanoezio-melotti
authored andcommitted
bpo-37014: Update docstring and Documentation of fileinput.FileInput(). (GH-13545)
* bpo-37014: Update docstring and Documentation of fileinput.FileInput() * Explain the behavior of fileinput.FileInput() when reading stdin. * Update blurb. * bpo-37014: Fix typo in the docstring and documentation.
1 parent 3caf4de commit aca273e

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Doc/library/fileinput.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ The typical use is::
2323

2424
This iterates over the lines of all files listed in ``sys.argv[1:]``, defaulting
2525
to ``sys.stdin`` if the list is empty. If a filename is ``'-'``, it is also
26-
replaced by ``sys.stdin``. To specify an alternative list of filenames, pass it
27-
as the first argument to :func:`.input`. A single file name is also allowed.
26+
replaced by ``sys.stdin`` and the optional arguments *mode* and *openhook*
27+
are ignored. To specify an alternative list of filenames, pass it as the
28+
first argument to :func:`.input`. A single file name is also allowed.
2829

2930
All files are opened in text mode by default, but you can override this by
3031
specifying the *mode* parameter in the call to :func:`.input` or

Lib/fileinput.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
99
This iterates over the lines of all files listed in sys.argv[1:],
1010
defaulting to sys.stdin if the list is empty. If a filename is '-' it
11-
is also replaced by sys.stdin. To specify an alternative list of
12-
filenames, pass it as the argument to input(). A single file name is
13-
also allowed.
11+
is also replaced by sys.stdin and the optional arguments mode and
12+
openhook are ignored. To specify an alternative list of filenames,
13+
pass it as the argument to input(). A single file name is also allowed.
1414
1515
Functions filename(), lineno() return the filename and cumulative line
1616
number of the line that has just been read; filelineno() returns its

Misc/ACKS

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Juancarlo Añez
5555
Chris Angelico
5656
Jérémy Anger
5757
Jon Anglin
58+
Michele Angrisano
5859
Ankur Ankan
5960
Heidi Annexstad
6061
Ramchandra Apte

0 commit comments

Comments
 (0)