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