| 2565 | self.cfg_optimization_test(insts, insts, consts=[None]) |
| 2566 | |
| 2567 | def test_load_attr(self): |
| 2568 | insts = [ |
| 2569 | ("LOAD_FAST", 0, 1), |
| 2570 | ("LOAD_ATTR", 0, 2), |
| 2571 | ] |
| 2572 | expected = [ |
| 2573 | ("LOAD_FAST_BORROW", 0, 1), |
| 2574 | ("LOAD_ATTR", 0, 2), |
| 2575 | ] |
| 2576 | self.check(insts, expected) |
| 2577 | |
| 2578 | # Method call, leaves self on stack unconsumed |
| 2579 | insts = [ |
| 2580 | ("LOAD_FAST", 0, 1), |
| 2581 | ("LOAD_ATTR", 1, 2), |
| 2582 | ] |
| 2583 | expected = [ |
| 2584 | ("LOAD_FAST", 0, 1), |
| 2585 | ("LOAD_ATTR", 1, 2), |
| 2586 | ] |
| 2587 | self.check(insts, expected) |
| 2588 | |
| 2589 | def test_super_attr(self): |
| 2590 | insts = [ |