fix callback types

This commit is contained in:
wrapper 2026-03-29 16:44:41 +07:00
parent fe2d0eedb7
commit ae0e084251

View file

@ -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 = <DCCType.ARM11_CORTEX: 1>
@ -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:
...