Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 70d2c71

Browse files
committed
Issue #18315: Improve fileinput docs by adding 'bufsize' where missing and
replacing redundant signature in input() docstring with one-line summary. Original patch by Terrel Shumway.
1 parent 02e4a7b commit 70d2c71

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

Lib/fileinput.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,11 @@
9090

9191
def input(files=None, inplace=False, backup="", bufsize=0,
9292
mode="r", openhook=None):
93-
"""input(files=None, inplace=False, backup="", bufsize=0, \
94-
mode="r", openhook=None)
93+
"""Return an instance of the FileInput class, which can be iterated.
9594
96-
Create an instance of the FileInput class. The instance will be used
97-
as global state for the functions of this module, and is also returned
98-
to use during iteration. The parameters to this function will be passed
99-
along to the constructor of the FileInput class.
95+
The parameters are passed to the constructor of the FileInput class.
96+
The returned instance, in addition to being an iterator,
97+
keeps global state for the functions of this module,.
10098
"""
10199
global _state
102100
if _state and _state._file:
@@ -183,7 +181,7 @@ def isstdin():
183181
return _state.isstdin()
184182

185183
class FileInput:
186-
"""class FileInput([files[, inplace[, backup[, mode[, openhook]]]]])
184+
"""FileInput([files[, inplace[, backup[, bufsize, [, mode[, openhook]]]]]])
187185
188186
Class FileInput is the implementation of the module; its methods
189187
filename(), lineno(), fileline(), isfirstline(), isstdin(), fileno(),

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,7 @@ John W. Shipman
11251125
Joel Shprentz
11261126
Itamar Shtull-Trauring
11271127
Yue Shuaijie
1128+
Terrel Shumway
11281129
Eric Siegerman
11291130
Paul Sijben
11301131
SilentGhost

0 commit comments

Comments
 (0)