From ae0e084251938f7011da8f94d132c012247a7518 Mon Sep 17 00:00:00 2001 From: wrapper Date: Sun, 29 Mar 2026 16:44:41 +0700 Subject: [PATCH] fix callback types --- bindings/python/dynemu/__init__.pyi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bindings/python/dynemu/__init__.pyi b/bindings/python/dynemu/__init__.pyi index 89c185a..41d1274 100644 --- a/bindings/python/dynemu/__init__.pyi +++ b/bindings/python/dynemu/__init__.pyi @@ -6,6 +6,10 @@ import collections.abc import enum import typing __all__: list[str] = ['Dynemu'] + +type ReadCB = collections.abc.Callable[[int, int], int] +type WriteCB = collections.abc.Callable[[int, int, int], None] + class Dynemu: class DCCType(enum.Enum): ARM11_CORTEX: typing.ClassVar[Dynemu.DCCType] # value = @@ -28,16 +32,16 @@ class Dynemu: def mmio(self, vaddr: typing.SupportsInt | typing.SupportsIndex, size: typing.SupportsInt | typing.SupportsIndex) -> None: ... @typing.overload - def mmio(self, vaddr: typing.SupportsInt | typing.SupportsIndex, size: typing.SupportsInt | typing.SupportsIndex, read: collections.abc.Callable[[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], int]) -> None: + def mmio(self, vaddr: typing.SupportsInt | typing.SupportsIndex, size: typing.SupportsInt | typing.SupportsIndex, read: ReadCB) -> None: ... @typing.overload - def mmio(self, vaddr: typing.SupportsInt | typing.SupportsIndex, size: typing.SupportsInt | typing.SupportsIndex, write: collections.abc.Callable[[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], None]) -> None: + def mmio(self, vaddr: typing.SupportsInt | typing.SupportsIndex, size: typing.SupportsInt | typing.SupportsIndex, write: WriteCB) -> None: ... @typing.overload - def mmio(self, vaddr: typing.SupportsInt | typing.SupportsIndex, size: typing.SupportsInt | typing.SupportsIndex, read: collections.abc.Callable[[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], int], write: collections.abc.Callable[[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], None]) -> None: + def mmio(self, vaddr: typing.SupportsInt | typing.SupportsIndex, size: typing.SupportsInt | typing.SupportsIndex, read: ReadCB, write: WriteCB) -> None: ... @typing.overload - def mmio(self, vaddr: typing.SupportsInt | typing.SupportsIndex, size: typing.SupportsInt | typing.SupportsIndex, write: collections.abc.Callable[[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], None], read: collections.abc.Callable[[typing.SupportsInt | typing.SupportsIndex, typing.SupportsInt | typing.SupportsIndex], int]) -> None: + def mmio(self, vaddr: typing.SupportsInt | typing.SupportsIndex, size: typing.SupportsInt | typing.SupportsIndex, write: WriteCB, read: ReadCB) -> None: ... def read_bytes(self, vaddr: typing.SupportsInt | typing.SupportsIndex, size: typing.SupportsInt | typing.SupportsIndex) -> bytes: ...