title: Equivalent C union in python?
body: <p>Say I'm having a following code in C</p>
  
  <pre><code>union u_type
  {
      uint32_t data;
      uint8_t  chunk[4];
  } 32bitsdata;
  
  32bitsdata.chunk[0] = some number;
  32bitsdata.chunk[1] = some number;
  32bitsdata.chunk[2] = some number;
  32bitsdata.chunk[3] = some number;
  
  printf("Data in 32 bits: %d\n", 32bitsdata.data);
  </code></pre>
  
  <p>How could I do similar thing in python?</p>
  
  <p>I'm trying to read a binary file (byte by byte) - already got it working, and combining every 3 bytes into one int. Heard struct would do the trick, but I'm not really sure how.</p>
  
  <p>Best,</p>
  
  <p>Henry</p>