refactor: add base parse module
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
from typing import Generic, TypeVar
|
||||
|
||||
D = TypeVar("D")
|
||||
R = TypeVar("R")
|
||||
|
||||
|
||||
class ParseError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class Parser(Generic[D, R]):
|
||||
def parse(self, data: D) -> R:
|
||||
raise NotImplementedError
|
||||
Reference in New Issue
Block a user