(self, end=None)
return f'{line_number}:{end_val - last_line_start}'
Given an absolute position in the input data, return a pair of
        line number + relative position to the start of the line.
Given an absolute position in the input data, return a pair of
        line number + relative position to the start of the line.
Given an absolute position in the input data return a pair of line number + relative position to the start of the line .
def linepos(self, end=None) -> str:
        """Given an absolute position in the input data, return a pair of
        line number + relative position to the start of the line.
        """
        end_val: int = self.pos if end is None else end
        data = self.data[:end_val]
        # if not found, rfind returns -1, and -1+1=0, which is perfect!
        last_line_start = data.rfind('\n') + 1
        # it's easy to forget this, but line numbers are 1-indexed
        line_number = data.count('\n') + 1
        return f'{line_number}:{end_val - last_line_start}'
def linepos ( self , end = None ) -> str : end_val : int = self . pos if end is None else end data = self . data [ : end_val ] # if not found, rfind returns -1, and -1+1=0, which is perfect! last_line_start = data . rfind ( '\n' ) + 1 # it's easy to forget this, but line numbers are 1-indexed line_number = data . count ( '\n' ) + 1 return f'{line_number}:{end_val - last_line_start}'