summaryrefslogtreecommitdiff
path: root/tests/micropython/heapalloc_super.py
blob: 1cf5293d2d28661c2e2069e3f7976952d6ceb5ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# test super() operations which don't require allocation
import micropython

class A:
    def foo(self):
        print('A foo')
        return 42
class B(A):
    def foo(self):
        print('B foo')
        print(super().foo())

b = B()

micropython.heap_lock()
b.foo()
micropython.heap_unlock()