parent
dd11af209d
commit
30badd1ce1
@ -0,0 +1,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()
|
@ -0,0 +1,3 @@
|
||||
B foo
|
||||
A foo
|
||||
42
|
Loading…
Reference in new issue