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

Function nextfile

Lib/fileinput.py:101–113  ·  view source on GitHub ↗

Close the current file so that the next iteration will read the first line from the next file (if any); lines not read from the file will not count towards the cumulative line count. The filename is not changed until after the first line of the next file has been read. Before th

()

Source from the content-addressed store, hash-verified

99 state.close()
100
101def nextfile():
102 """
103 Close the current file so that the next iteration will read the first
104 line from the next file (if any); lines not read from the file will
105 not count towards the cumulative line count. The filename is not
106 changed until after the first line of the next file has been read.
107 Before the first line has been read, this function has no effect;
108 it cannot be used to skip the first file. After the last line of the
109 last file has been read, this function has no effect.
110 """
111 if not _state:
112 raise RuntimeError("no active input()")
113 return _state.nextfile()
114
115def filename():
116 """

Callers

nothing calls this directly

Calls 1

nextfileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…