From ee7659bda26ff0b05501e105641d91371b15c766 Mon Sep 17 00:00:00 2001 From: timofey Date: Tue, 29 Nov 2022 14:28:09 +0000 Subject: [PATCH] abstractmethod --- ptvp35/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ptvp35/__init__.py b/ptvp35/__init__.py index 52e7ea6..0f87f27 100644 --- a/ptvp35/__init__.py +++ b/ptvp35/__init__.py @@ -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)