From 2da154721b30ed56605d3e6dad69db17f5930328 Mon Sep 17 00:00:00 2001 From: elicn Date: Thu, 19 Sep 2024 17:00:33 +0300 Subject: [PATCH] Remove repr surplus method --- bindings/python/unicorn/unicorn_py3/arch/arm.py | 4 ---- bindings/python/unicorn/unicorn_py3/arch/types.py | 4 ---- bindings/python/unicorn/unicorn_py3/unicorn.py | 6 ------ 3 files changed, 14 deletions(-) diff --git a/bindings/python/unicorn/unicorn_py3/arch/arm.py b/bindings/python/unicorn/unicorn_py3/arch/arm.py index 98b5c91e..46c00c7a 100644 --- a/bindings/python/unicorn/unicorn_py3/arch/arm.py +++ b/bindings/python/unicorn/unicorn_py3/arch/arm.py @@ -15,9 +15,6 @@ from .types import UcTupledReg, UcReg128 ARMCPReg = Tuple[int, int, int, int, int, int, int, int] -def _structure_repr(self): - return "%s(%s)" % (self.__class__.__name__, ", ".join("%s=%s" % (k, getattr(self, k)) for (k, _) in self._fields_)) - class UcRegCP(UcTupledReg[ARMCPReg]): """ARM coprocessors registers for instructions MRC, MCR, MRRC, MCRR @@ -38,7 +35,6 @@ class UcRegCP(UcTupledReg[ARMCPReg]): def value(self) -> int: return self.val - __repr__ = _structure_repr class UcAArch32(Uc): """Unicorn subclass for ARM architecture. diff --git a/bindings/python/unicorn/unicorn_py3/arch/types.py b/bindings/python/unicorn/unicorn_py3/arch/types.py index ea6f471f..8c0a9b63 100644 --- a/bindings/python/unicorn/unicorn_py3/arch/types.py +++ b/bindings/python/unicorn/unicorn_py3/arch/types.py @@ -15,9 +15,6 @@ uc_hook_h = ctypes.c_size_t VT = TypeVar('VT', bound=Tuple[int, ...]) -def _structure_repr(self): - return "%s(%s)" % (self.__class__.__name__, ", ".join("%s=%s" % (k, getattr(self, k)) for (k, _) in self._fields_)) - class UcReg(ctypes.Structure): """A base class for composite registers. @@ -41,7 +38,6 @@ class UcReg(ctypes.Structure): pass - _repr_ = _structure_repr class UcTupledReg(UcReg, Generic[VT]): """A base class for registers whose values are represented as a set diff --git a/bindings/python/unicorn/unicorn_py3/unicorn.py b/bindings/python/unicorn/unicorn_py3/unicorn.py index 7a1db01d..7460edb9 100644 --- a/bindings/python/unicorn/unicorn_py3/unicorn.py +++ b/bindings/python/unicorn/unicorn_py3/unicorn.py @@ -10,9 +10,6 @@ from .arch.types import uc_err, uc_engine, uc_context, uc_hook_h, UcReg # __version__ = f'{uc.UC_VERSION_MAJOR}.{uc.UC_VERSION_MINOR}.{uc.UC_VERSION_PATCH}' -def _structure_repr(self): - return "%s(%s)" % (self.__class__.__name__, ", ".join("%s=%s" % (k, getattr(self, k)) for (k, _) in self._fields_)) - class _uc_mem_region(ctypes.Structure): _fields_ = ( @@ -25,7 +22,6 @@ class _uc_mem_region(ctypes.Structure): def value(self) -> Tuple[int, int, int]: return tuple(getattr(self, fname) for fname, _ in self._fields_) - __repr__ = _structure_repr class uc_tb(ctypes.Structure): """"TranslationBlock @@ -36,8 +32,6 @@ class uc_tb(ctypes.Structure): ('icount', ctypes.c_uint16), ('size', ctypes.c_uint16) ) - - __repr__ = _structure_repr def __load_uc_lib() -> ctypes.CDLL: