mirror of
https://github.com/idapython/src
synced 2026-06-08 14:47:00 +00:00
Simplifies _print_hex method
Simplifies the `_print_hex` method.
Note that there are ~4 different ways of implementing it:
```
In [1]: def a(x):
...: return hex(x).rstrip('L')
...: def b(x):
...: s = hex(x)
...: return s[0:-1] if s.endswith("L") else s
...: def c(x):
...: return '0x%x' % x
...: def d(x):
...: return '0x{:x}'.format(x)
```
This commit is contained in:
@@ -694,8 +694,7 @@ class IDAPython_displayhook:
|
||||
storage.append(str(item))
|
||||
|
||||
def _print_hex(self, x):
|
||||
s = hex(x)
|
||||
return s[0:-1] if s.endswith("L") else s
|
||||
return hex(x).rstrip('L')
|
||||
|
||||
def displayhook(self, item):
|
||||
if item is None or type(item) is bool:
|
||||
|
||||
Reference in New Issue
Block a user