| 3301 | return hash(('MLIL', self._source_function)) |
| 3302 | |
| 3303 | def __getitem__(self, i) -> 'MediumLevelILInstruction': |
| 3304 | if isinstance(i, slice) or isinstance(i, tuple): |
| 3305 | raise IndexError("expected integer instruction index") |
| 3306 | elif isinstance(i, MediumLevelILInstruction): # for backwards compatibility |
| 3307 | return i |
| 3308 | if i < -len(self) or i >= len(self): |
| 3309 | raise IndexError("index out of range") |
| 3310 | if i < 0: |
| 3311 | i = len(self) + i |
| 3312 | return MediumLevelILInstruction.create( |
| 3313 | self, ExpressionIndex(core.BNGetMediumLevelILIndexForInstruction(self.handle, i)), i |
| 3314 | ) |
| 3315 | |
| 3316 | def __setitem__(self, i, j): |
| 3317 | raise IndexError("instruction modification not implemented") |