mirror of
https://github.com/python/cpython.git
synced 2025-10-08 08:01:55 +00:00
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.
This commit is contained in:
parent
02e4a7b4a3
commit
70d2c711f1
2 changed files with 6 additions and 7 deletions
|
@ -90,13 +90,11 @@ DEFAULT_BUFSIZE = 8*1024
|
||||||
|
|
||||||
def input(files=None, inplace=False, backup="", bufsize=0,
|
def input(files=None, inplace=False, backup="", bufsize=0,
|
||||||
mode="r", openhook=None):
|
mode="r", openhook=None):
|
||||||
"""input(files=None, inplace=False, backup="", bufsize=0, \
|
"""Return an instance of the FileInput class, which can be iterated.
|
||||||
mode="r", openhook=None)
|
|
||||||
|
|
||||||
Create an instance of the FileInput class. The instance will be used
|
The parameters are passed to the constructor of the FileInput class.
|
||||||
as global state for the functions of this module, and is also returned
|
The returned instance, in addition to being an iterator,
|
||||||
to use during iteration. The parameters to this function will be passed
|
keeps global state for the functions of this module,.
|
||||||
along to the constructor of the FileInput class.
|
|
||||||
"""
|
"""
|
||||||
global _state
|
global _state
|
||||||
if _state and _state._file:
|
if _state and _state._file:
|
||||||
|
@ -183,7 +181,7 @@ def isstdin():
|
||||||
return _state.isstdin()
|
return _state.isstdin()
|
||||||
|
|
||||||
class FileInput:
|
class FileInput:
|
||||||
"""class FileInput([files[, inplace[, backup[, mode[, openhook]]]]])
|
"""FileInput([files[, inplace[, backup[, bufsize, [, mode[, openhook]]]]]])
|
||||||
|
|
||||||
Class FileInput is the implementation of the module; its methods
|
Class FileInput is the implementation of the module; its methods
|
||||||
filename(), lineno(), fileline(), isfirstline(), isstdin(), fileno(),
|
filename(), lineno(), fileline(), isfirstline(), isstdin(), fileno(),
|
||||||
|
|
|
@ -1125,6 +1125,7 @@ John W. Shipman
|
||||||
Joel Shprentz
|
Joel Shprentz
|
||||||
Itamar Shtull-Trauring
|
Itamar Shtull-Trauring
|
||||||
Yue Shuaijie
|
Yue Shuaijie
|
||||||
|
Terrel Shumway
|
||||||
Eric Siegerman
|
Eric Siegerman
|
||||||
Paul Sijben
|
Paul Sijben
|
||||||
SilentGhost
|
SilentGhost
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue