summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2023-03-28 15:08:48 -0400
committerPeter LaFosse <peter@vector35.com>2023-03-29 15:33:08 -0400
commit8d791bc9eb608139c6fd9d99ab0d96ed37561d3a (patch)
tree6c7b4d3c0b9cb8b1c08d21da318f2080b7e2a5d5 /python
parenteccbcdea4a23ce50a586decfcec5e7454ea049e4 (diff)
Fix some type hints using more correct Dict instead of Mapping
Diffstat (limited to 'python')
-rw-r--r--python/highlevelil.py1
-rw-r--r--python/mediumlevelil.py8
-rw-r--r--python/variable.py4
3 files changed, 6 insertions, 7 deletions
diff --git a/python/highlevelil.py b/python/highlevelil.py
index a267101f..0c5e7992 100644
--- a/python/highlevelil.py
+++ b/python/highlevelil.py
@@ -116,7 +116,6 @@ class GotoLabel:
def uses(self) -> List['HighLevelILInstruction']:
return self.function.get_label_uses(self.id)
-
@dataclass(frozen=True, order=True)
class CoreHighLevelILInstruction:
operation: HighLevelILOperation
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index 94311f13..f2181ad6 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -57,7 +57,7 @@ OperandsType = Tuple[ExpressionIndex, ExpressionIndex, ExpressionIndex, Expressi
MediumLevelILOperandType = Union[int, float, 'MediumLevelILOperationAndSize', 'MediumLevelILInstruction',
'lowlevelil.ILIntrinsic', 'variable.Variable', 'SSAVariable', List[int],
List['variable.Variable'], List['SSAVariable'], List['MediumLevelILInstruction'],
- Mapping[int, int], 'variable.ConstantData']
+ Dict[int, int], 'variable.ConstantData']
MediumLevelILVisitorCallback = Callable[[str, MediumLevelILOperandType, str, Optional['MediumLevelILInstruction']], bool]
StringOrType = Union[str, '_types.Type', '_types.TypeBuilder']
ILInstructionAttributeSet = Union[Set[ILInstructionAttribute], List[ILInstructionAttribute]]
@@ -962,7 +962,7 @@ class MediumLevelILInstruction(BaseILInstruction):
finally:
core.BNMediumLevelILFreeOperandList(operand_list)
- def _get_target_map(self, operand_index1: int, _: int) -> Mapping[int, int]:
+ def _get_target_map(self, operand_index1: int, _: int) -> Dict[int, int]:
count = ctypes.c_ulonglong()
operand_list = core.BNMediumLevelILGetOperandList(self.function.handle, self.expr_index, operand_index1, count)
assert operand_list is not None, "core.BNMediumLevelILGetOperandList returned None"
@@ -1979,14 +1979,14 @@ class MediumLevelILJumpTo(MediumLevelILInstruction, Terminal):
return self._get_expr(0)
@property
- def targets(self) -> Mapping[int, int]:
+ def targets(self) -> Dict[int, int]:
return self._get_target_map(1, 2)
@property
def detailed_operands(self) -> List[Tuple[str, MediumLevelILOperandType, str]]:
return [
('dest', self.dest, 'MediumLevelILInstruction'),
- ('targets', self.targets, 'Mapping[int, int]'),
+ ('targets', self.targets, 'Dict[int, int]'),
]
diff --git a/python/variable.py b/python/variable.py
index 09b24e9c..2ab0a9fe 100644
--- a/python/variable.py
+++ b/python/variable.py
@@ -20,7 +20,7 @@
# IN THE SOFTWARE.
import ctypes
-from typing import List, Generator, Optional, Union, Set, Mapping
+from typing import List, Generator, Optional, Union, Set, Dict
from dataclasses import dataclass
import binaryninja
@@ -470,7 +470,7 @@ class PossibleValueSet:
return self._table
@property
- def mapping(self) -> Mapping[int, int]:
+ def mapping(self) -> Dict[int, int]:
return self._mapping
@property