'Return position for \'end\' or line overflow corresponding to endflag.
-1: position before terminal
; for .insert(), .delete
0: position after terminal
; for .get, .delete index 1
1: same viewed as beginning of non-existent next line (for .index)'

def _endex(self, endflag):

    n = len(self.data)
    if (endflag == 1):
        return (n, 0)
    else:
        n -= 1
        return (n, (len(self.data[n]) + endflag))
