MCPcopy Index your code
hub / github.com/RustPython/RustPython / readline

Method readline

Lib/email/feedparser.py:79–95  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

77 self._closed = True
78
79 def readline(self):
80 if not self._lines:
81 if self._closed:
82 return ''
83 return NeedMoreData
84 # Pop the line off the stack and see if it matches the current
85 # false-EOF predicate.
86 line = self._lines.popleft()
87 # RFC 2046, section 5.1.2 requires us to recognize outer level
88 # boundaries at any level of inner nesting. Do this, but be sure it's
89 # in the order of most to least nested.
90 for ateof in reversed(self._eofstack):
91 if ateof(line):
92 # We're at the false EOF. But push the last line back first.
93 self._lines.appendleft(line)
94 return ''
95 return line
96
97 def unreadline(self, line):
98 # Let the consumer push a line back into the buffer.

Callers 2

__next__Method · 0.95
_parsegenMethod · 0.45

Calls 3

reversedFunction · 0.85
popleftMethod · 0.80
appendleftMethod · 0.80

Tested by

no test coverage detected