2016-12-28 04:29:21 +00:00
|
|
|
# test MicroPython-specific features of array.array
|
2017-02-14 21:57:56 +00:00
|
|
|
try:
|
2019-10-22 07:33:23 +01:00
|
|
|
import uarray as array
|
2017-02-14 21:57:56 +00:00
|
|
|
except ImportError:
|
2019-10-22 07:33:23 +01:00
|
|
|
try:
|
|
|
|
import array
|
|
|
|
except ImportError:
|
|
|
|
print("SKIP")
|
|
|
|
raise SystemExit
|
2016-12-28 04:29:21 +00: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])
|