abstractmethod

This commit is contained in:
AF 2022-11-29 14:28:09 +00:00
parent e92d860b25
commit ee7659bda2

View File

@ -62,11 +62,13 @@ note: unstable signature."""
__slots__ = ()
@abc.abstractmethod
def line(self, key: Any, value: Any, /) -> str:
"""line must contain exactly one '\\n' at exactly the end if the line is not empty.
note: other forms of requests will later be represented by different methods or by instances of Action class."""
raise NotImplementedError
@abc.abstractmethod
def fromline(self, line: str, /) -> tuple[Any, Any]:
"""inverse of line().
note: unstable signature."""
@ -238,19 +240,24 @@ class VirtualConnection(abc.ABC):
__slots__ = ()
@abc.abstractmethod
def get(self, key: Any, default: Any, /):
raise NotImplementedError
@abc.abstractmethod
async def commit_transaction(self, delta: dict, /) -> None:
raise NotImplementedError
@abc.abstractmethod
def submit_transaction_request(self, delta: dict, future: asyncio.Future | None, /) -> None:
raise NotImplementedError
@abc.abstractmethod
@nightly
def loop(self, /) -> asyncio.AbstractEventLoop:
raise NotImplementedError
@abc.abstractmethod
def transaction(self, /) -> 'Transaction':
return Transaction(self)