def test_delattr(self): a = ir.DelAttr(self.var_a, 'foo', self.loc1) b = ir.DelAttr(self.var_a, 'foo', self.loc1) c = ir.DelAttr(self.var_a, 'foo', self.loc2) d = ir.DelAttr(self.var_c, 'foo', self.loc1) e = ir.DelAttr(self.var_a, 'bar', self.loc1) self.check(a, same=[b, c], different=[d, e])
def op_DELETE_ATTR(self, inst, target): attr = self.code_names[inst.arg] sa = ir.DelAttr(target=self.get(target), attr=attr, loc=self.loc) self.current_block.append(sa)