title: Python join on byte array
body: <p>I need to loop through an array of byte arrays and then select a matching element from a dictionary. However my attempt to join the byte array fails:</p>
  
  <pre><code>roms = {
    "\xff\xfe\x88\x84\x16\x03\xd1":"living_room",
    "\x10\xe5x\xd5\x01\x08\x007":"bed_room"
  }
  
  devices = [bytearray(b'(\xff\xfe\x88\x84\x16\x03\xd1'), bytearray(b'\x10\xe5x\xd5\x01\x08\x007')]
  for device in devices:
    DEV = "".join(device)
    print(roms[DEV])
  
  &gt;&gt; TypeError: sequence item 0: expected str instance, int found
  </code></pre>
  
  <p>So it appears that you can't join an integer, is there another way?</p>
  
  <h1>UPDATE 1</h1>
  
  <p>With much help and patience from @falsetrue, I have managed to join the array. However the resulting string still throws a key error when I attempt to get the devices dictionary item:</p>
  
  <pre><code>roms = {
    "\xff\xfe\x88\x84\x16\x03\xd1":"living_room",
    "\x10\xe5x\xd5\x01\x08\x007":"bed_room"
  }
  
  devices = [bytearray(b'(\xff\xfe\x88\x84\x16\x03\xd1'), bytearray(b'\x10\xe5x\xd5\x01\x08\x007')]
  
  for device in devices:
    DEV = str(bytes(device)).strip('b').strip("'").strip('(') # &gt; this results in: \xff\xfe\x88\x84\x16\x03\xd1 - but still gives keyError
    #DEV = bytes(device).lstrip(b'(') # &gt; This results in: b'\xff\xfe\x88\x84\x16\x03\xd1' - keyError
    print(DEV)
    print(roms["\xff\xfe\x88\x84\x16\x03\xd1"])
    print(roms[DEV])
    print()
  
  &gt;&gt; \xff\xfe\x88\x84\x16\x03\xd1
  &gt;&gt; living_room
  &gt;&gt; KeyError: \xff\xfe\x88\x84\x16\x03\xd1
  </code></pre>
  
  <h1>UPDATE 2</h1>
  
  <p>Here's the device info:</p>
  
  <pre><code>release='1.3.0.b1', 
  version='v1.8.6-379-gc44ebac on 2017-01-13', 
  machine='WiPy with ESP32'
  </code></pre>
  
  <p><strong>Maybe someone else with a WIPY2 can verify this for me?</strong></p>