2016-12-28 15:29:21 +11:00
|
|
|
# test MicroPython-specific features of array.array
|
2017-02-15 00:57:56 +03:00
|
|
|
try:
|
|
|
|
import array
|
|
|
|
except ImportError:
|
|
|
|
print("SKIP")
|
2017-06-10 20:03:01 +03:00
|
|
|
raise SystemExit
|
2016-12-28 15:29:21 +11:00
|
|
|
|
|
|
|
# arrays of objects
|
|
|
|
a = array.array('O')
|
|
|
|
a.append(1)
|
|
|
|
print(a[0])
|
|
|
|
|
|
|
|
# arrays of pointers
|
|
|
|
a = array.array('P')
|
|
|
|
a.append(1)
|
|
|
|
print(a[0])
|