title: Python byte array to bit array
body: <p>I want to parse some data with Python and scapy.
  Therefor I have to analyse single bits. But at the moment I have for example UDP packets with some payload like:</p>
  <pre><code>bytes = b'\x18\x00\x03\x61\xFF\xFF\x00\x05\x42\xFF\xFF\xFF\xFF'
  </code></pre>
  <p>Is there any elegant way to convert the bytes so that I can access single bits like:</p>
  <pre><code>bytes_as_bits = convert(bytes)
  bit_at_index_42 = bytes_as_bits[42]
  </code></pre>