Add Python support.

This commit is contained in:
2026-04-25 17:10:41 +01:00
parent 5ff4b3ee5c
commit 48adf25837
11 changed files with 467 additions and 14 deletions

View File

@@ -0,0 +1,30 @@
from __future__ import annotations
from typing import BinaryIO, Generator, Protocol, TypeAlias
CaseVariable: TypeAlias = bool | int | str
class ReadFileFn(Protocol):
def __call__(self, key: str, id: int) -> BinaryIO: ...
class WriteFileFn(Protocol):
def __call__(self, key: str, id: int) -> BinaryIO: ...
class ProcessFn(Protocol):
def __call__(
self,
request: int,
read_file: ReadFileFn,
write_file: WriteFileFn,
) -> Generator[tuple[int, CaseVariable], None, None]: ...
__all__ = [
"CaseVariable",
"ReadFileFn",
"WriteFileFn",
"ProcessFn",
]