title: Use method inherited from abtract C++ class in a Python class (SWIG)
body: <p>I am currently using SWIG to make the implementation of small modules easier in my main C++ programm. The class architecture is as follow :</p>
  
  <p>foo.hpp :</p>
  
  <pre><code>class Foo
  {
  public:
    virtual int pureFunc() = 0;
    int func() { return (42); }
  };
  </code></pre>
  
  <p>file.i :</p>
  
  <pre><code>%module(directors="1") foo
  %feature("director") Foo;
  %{
    #include "foo.hpp"
  %}
  %include "foo.hpp"
  </code></pre>
  
  <p>file.py :</p>
  
  <pre><code>import sys
  sys.path.append('.')
  import foo
  
  class Bar(foo.Foo):
      def __init__(self):
          pass
      def pureFunc(self):
          return 21
  
  lol = Bar()
  print lol.pureFunc()
  print lol.func()
  </code></pre>
  
  <p>I then generate the swig wrappers using the following command :</p>
  
  <pre><code>swig -python -c++ file.i
  </code></pre>
  
  <p>and compile the .so like this :</p>
  
  <pre><code>g++ -fPIC -shared -o _foo.so file_wrap.cxx -I/usr/include/python2.7 -lpython2.7
  </code></pre>
  
  <p>And when I try to run the python script I get the following error :</p>
  
  <pre><code># python file.py 
  21
  Traceback (most recent call last):
    File "file.py", line 13, in &lt;module&gt;
      print lol.func()
    File "/home/volent/dev/CPP/cython/foo.py", line 84, in func
      def func(self): return _foo.Foo_func(self)
  TypeError: in method 'Foo_func', argument 1 of type 'Foo *'
  # _
  </code></pre>
  
  <p>That shows that the use of the pure method is working but I can't use the one already defined in the .hpp file.</p>
  
  <p>I have tried to read the SWIG documentation and the only things I see about abstract class and inheritance are <a href="http://www.swig.org/Doc2.0/Python.html#Python_nn20" rel="nofollow">34.4.7 C++ Classes</a> and <a href="http://www.swig.org/Doc2.0/Python.html#Python_nn21" rel="nofollow">34.4.8 C++ Inheritance</a>. And I can't see anything mentionning a case like that.</p>