title: python bitwise operations on C data types?
body: <p>Is it possible to do bitwise operations on C data types in Python?</p>
  
  <pre><code>Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) 
  [GCC 4.5.2] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; from ctypes import c_uint8
  &gt;&gt;&gt; foo = c_uint8(4)
  &gt;&gt;&gt; foo &lt;&lt; 1
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: unsupported operand type(s) for &lt;&lt;: 'c_ubyte' and 'int'
  &gt;&gt;&gt;
  </code></pre>