title: Changing string to byte type in Python 2.7
body: <p>In python 3.2, i can change the type of an object easily. For example :</p>
  
  <pre><code>x=0
  print(type (x))
  x=bytes(0)
  print(type (x))
  </code></pre>
  
  <p>it will give me this :</p>
  
  <pre><code>&lt;class 'int'&gt;
  &lt;class 'bytes'&gt;
  </code></pre>
  
  <p>But, in python 2.7, it seems that i can't use the same way to do it. If i do the same code, it give me this :</p>
  
  <pre><code>&lt;type 'int'&gt;
  &lt;type 'str'&gt;
  </code></pre>
  
  <p>What can i do to change the type into a bytes type?</p>