Reviewed-on: #1 Co-authored-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com> Co-committed-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com>
14 lines
372 B
Python
14 lines
372 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Generic, TypeVar, Set
|
|
from .content import Content, ContentType
|
|
|
|
T = TypeVar("T")
|
|
|
|
class BaseParser(ABC, Generic[T]):
|
|
supported_types: Set[ContentType]
|
|
content: Content
|
|
def __init__(self, content: Content) -> None: ...
|
|
@abstractmethod
|
|
def parse(self) -> T: ...
|
|
def supports(self) -> bool: ...
|