title: understand difference between encode() and bytearray
body: <p>If I have :</p>
  <pre><code>my_str = '0xfe'
  str_enc = my_str.encode()
  &gt;&gt; str_enc
  b'0xfe'
  &gt;&gt;type(str_enc)
  &lt;class 'bytes'&gt;
  
  a_lst = [my_str]
  byte_arr = bytes([int(x,0) for x in a_lst])
  &gt;&gt;byte_arr
  b'\xfe'
  &gt;&gt;type(byte_arr)
  &lt;class 'bytes'&gt;
  &gt;&gt;str_enc == byte_arr
  False
  </code></pre>
  <p>Shouldn't these 2 be equal? I'm developing a Client application using sockets and the common theme to send data is to use the send() function:</p>
  <pre><code>send('mydata'.encode())
  </code></pre>
  <p>since they are not equal does it mean I won't be able to send the bytearray directly?</p>
  <pre><code>send(byte_arr)
  </code></pre>