bytes_construct_array.py 228 B

12345678910
  1. # test construction of bytes from different objects
  2. try:
  3. from array import array
  4. except ImportError:
  5. print("SKIP")
  6. raise SystemExit
  7. # arrays
  8. print(bytes(array('b', [1, 2])))
  9. print(bytes(array('h', [0x101, 0x202])))