MCPcopy Index your code
hub / github.com/python/cpython / input

Function input

Lib/fileinput.py:78–91  ·  view source on GitHub ↗

Return an instance of the FileInput class, which can be iterated. The parameters are passed to the constructor of the FileInput class. The returned instance, in addition to being an iterator, keeps global state for the functions of this module,.

(files=None, inplace=False, backup="", *, mode="r", openhook=None,
          encoding=None, errors=None)

Source from the content-addressed store, hash-verified

76_state = None
77
78def input(files=None, inplace=False, backup="", *, mode="r", openhook=None,
79 encoding=None, errors=None):
80 """Return an instance of the FileInput class, which can be iterated.
81
82 The parameters are passed to the constructor of the FileInput class.
83 The returned instance, in addition to being an iterator,
84 keeps global state for the functions of this module,.
85 """
86 global _state
87 if _state and _state._file:
88 raise RuntimeError("input() already active")
89 _state = FileInput(files, inplace, backup, mode=mode, openhook=openhook,
90 encoding=encoding, errors=errors)
91 return _state
92
93def close():
94 """Close the sequence."""

Callers 15

getlineMethod · 0.85
browseFunction · 0.85
cmdloopMethod · 0.85
raw_inputMethod · 0.85
_testFunction · 0.85
_read_codeMethod · 0.85
do_quitMethod · 0.85
read_inputMethod · 0.85
test_inputMethod · 0.85
test_input_gh130163Method · 0.85

Calls 1

FileInputClass · 0.85

Tested by 5

test_inputMethod · 0.68
test_input_gh130163Method · 0.68
childMethod · 0.68
test_captured_stdinMethod · 0.68
assertStdinRoundTripMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…