MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_load_attr

Method test_load_attr

Lib/test/test_peepholer.py:2567–2587  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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 = [

Callers

nothing calls this directly

Calls 1

checkMethod · 0.95

Tested by

no test coverage detected