MCPcopy Create free account
hub / github.com/theskumar/python-dotenv / Position

Class Position

src/dotenv/parser.py:40–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38
39
40class Position:
41 def __init__(self, chars: int, line: int) -> None:
42 self.chars = chars
43 self.line = line
44
45 @classmethod
46 def start(cls) -> "Position":
47 return cls(chars=0, line=1)
48
49 def set(self, other: "Position") -> None:
50 self.chars = other.chars
51 self.line = other.line
52
53 def advance(self, string: str) -> None:
54 self.chars += len(string)
55 self.line += len(re.findall(_newline, string))
56
57
58class Error(Exception):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected