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

Method nreadahead

Lib/_pyio.py:521–528  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

519 # For backwards compatibility, a (slowish) readline().
520 if hasattr(self, "peek"):
521 def nreadahead():
522 readahead = self.peek(1)
523 if not readahead:
524 return 1
525 n = (readahead.find(b"\n") + 1) or len(readahead)
526 if size >= 0:
527 n = min(n, size)
528 return n
529 else:
530 def nreadahead():
531 return 1

Callers

nothing calls this directly

Calls 2

peekMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected