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

Method bol

Lib/_pyrepl/reader.py:444–455  ·  view source on GitHub ↗

Return the 0-based index of the line break preceding p most immediately. p defaults to self.pos.

(self, p: int | None = None)

Source from the content-addressed store, hash-verified

442 return p
443
444 def bol(self, p: int | None = None) -> int:
445 """Return the 0-based index of the line break preceding p most
446 immediately.
447
448 p defaults to self.pos."""
449 if p is None:
450 p = self.pos
451 b = self.buffer
452 p -= 1
453 while p >= 0 and b[p] != "\n":
454 p -= 1
455 return p + 1
456
457 def eol(self, p: int | None = None) -> int:
458 """Return the 0-based index of the line break following p most

Callers 4

doMethod · 0.80
doMethod · 0.80
doMethod · 0.80
doMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected