title: Wrapping std::vector of boost::shared_ptr in SWIG for Python
body: <p><strong>EDIT:</strong> Solved, my mistake; explained in my answer.</p>
  
  <p>I have this:</p>
  
  <pre><code>std::vector &lt; boost::shared_ptr &lt; Entity &gt; &gt; entities;
  </code></pre>
  
  <p>and I try to expose it through SWIG like this:</p>
  
  <pre><code>%include "boost_shared_ptr.i"
  %include "std_vector.i"
  
  %shared_ptr(Entity)
  %include &lt;Entity.h&gt;
  
  namespace std {
      %template(EntityVector) vector&lt;boost::shared_ptr&lt;Entity&gt; &gt;;
  };
  
  %include &lt;TheFileWithEntities.h&gt;
  </code></pre>
  
  <p>However, in Python entities ends up being a tuple:</p>
  
  <pre><code>import MyModule
  print type(MyModule.cvar.entities)
  # Output: (type 'tuple')
  </code></pre>
  
  <p>I've Googled for this, but could not find any concrete examples on how to wrap this. One page gave a small example for wrapping it for C#, but it didn't help in my case.</p>
  
  <p>Any help is greatly appreciated.</p>