1# test super() operations which don't require allocation
2import micropython
3
4# Check for stackless build, which can't call functions without
5# allocating a frame on heap.
6try:
7
8    def stackless():
9        pass
10
11    micropython.heap_lock()
12    stackless()
13    micropython.heap_unlock()
14except RuntimeError:
15    print("SKIP")
16    raise SystemExit
17
18
19class A:
20    def foo(self):
21        print("A foo")
22        return 42
23
24
25class B(A):
26    def foo(self):
27        print("B foo")
28        print(super().foo())
29
30
31b = B()
32
33micropython.heap_lock()
34b.foo()
35micropython.heap_unlock()
36