2016-12-27 23:29:21 -05:00
|
|
|
# test MicroPython-specific features of array.array
|
2017-02-14 16:57:56 -05:00
|
|
|
try:
|
|
|
|
import array
|
|
|
|
except ImportError:
|
|
|
|
print("SKIP")
|
2017-06-10 13:03:01 -04:00
|
|
|
raise SystemExit
|
2016-12-27 23:29:21 -05:00
|
|
|
|
2018-03-26 19:13:49 -04:00
|
|
|
try:
|
|
|
|
array.array('O')
|
|
|
|
except ValueError:
|
|
|
|
print("SKIP")
|
|
|
|
raise SystemExit
|
|
|
|
|
2016-12-27 23:29:21 -05: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])
|