It would be nice to have __repr__ in more (or all) Python classes, e.g., operand displays could have more useful repr than just:
<capstone.x86.X86Op object at 0x7fe856a06640>
We did sth similar recently for the CsInsn in #1625
A lot of classes inherit from ctypes.Structure like in https://github.com/aquynh/capstone/blob/1b5014515d0d671048e2b43ce483d38d85a2bc83/bindings/python/capstone/x86.py so this could probably be implemented somehow generally by adding a base class that would inherit from ctypes.Structure and would use, .e.g., a _format field if its defined in the inherited class to go over fields we want to show and display them with given format?
It would be nice to have
__repr__in more (or all) Python classes, e.g., operand displays could have more useful repr than just:We did sth similar recently for the
CsInsnin #1625A lot of classes inherit from
ctypes.Structurelike in https://github.com/aquynh/capstone/blob/1b5014515d0d671048e2b43ce483d38d85a2bc83/bindings/python/capstone/x86.py so this could probably be implemented somehow generally by adding a base class that would inherit fromctypes.Structureand would use, .e.g., a_formatfield if its defined in the inherited class to go over fields we want to show and display them with given format?