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.
This commit is contained in:
Michele Angrisano 2019-06-02 23:01:49 +02:00 committed by Ezio Melotti
parent 3caf4de6f0
commit aca273e240
3 changed files with 7 additions and 5 deletions

View File

@ -23,8 +23,9 @@ The typical use is::
This iterates over the lines of all files listed in ``sys.argv[1:]``, defaulting This iterates over the lines of all files listed in ``sys.argv[1:]``, defaulting
to ``sys.stdin`` if the list is empty. If a filename is ``'-'``, it is also to ``sys.stdin`` if the list is empty. If a filename is ``'-'``, it is also
replaced by ``sys.stdin``. To specify an alternative list of filenames, pass it replaced by ``sys.stdin`` and the optional arguments *mode* and *openhook*
as the first argument to :func:`.input`. A single file name is also allowed. are ignored. To specify an alternative list of filenames, pass it as the
first argument to :func:`.input`. A single file name is also allowed.
All files are opened in text mode by default, but you can override this by All files are opened in text mode by default, but you can override this by
specifying the *mode* parameter in the call to :func:`.input` or specifying the *mode* parameter in the call to :func:`.input` or

View File

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

View File

@ -55,6 +55,7 @@ Juancarlo Añez
Chris Angelico Chris Angelico
Jérémy Anger Jérémy Anger
Jon Anglin Jon Anglin
Michele Angrisano
Ankur Ankan Ankur Ankan
Heidi Annexstad Heidi Annexstad
Ramchandra Apte Ramchandra Apte