@classmethod
def from_pos(cls, pos: int, text: str, message: str=None, filename: str=None):
    """Instantiate from a full *text* and a file position *pos*"""
    try:
        start = text.rindex('\n', 0, pos) + 1
    except ValueError:
        start = 0
    try:
        end = text.index('\n', start)
    except ValueError:
        end = len(text)
    lineno = text.count('\n', 0, start)
    line = text[start:end]
    return cls(message, filename=filename, lineno=lineno, offset=pos -
        start, text=line)
