1# test construction of array.array from different objects 2 3try: 4 from uarray import array 5except ImportError: 6 try: 7 from array import array 8 except ImportError: 9 print("SKIP") 10 raise SystemExit 11 12# tuple, list 13print(array('b', (1, 2))) 14print(array('h', [1, 2])) 15 16# raw copy from bytes, bytearray 17print(array('h', b'22')) # should be byteorder-neutral 18print(array('h', bytearray(2))) 19print(array('i', bytearray(4))) 20 21# convert from other arrays 22print(array('H', array('b', [1, 2]))) 23print(array('b', array('I', [1, 2]))) 24