title: When importing a swig generated module, Python is complaining about missing delete method
body: <p>We have a set of c++ classes wrapped by swig for python. When importing one of these classes in python, we're getting the following error message:</p>
  
  <pre><code>File ".../myobjects.py", line 176, in &lt;module&gt;
  class RT(_object):
  File ".../myobjects.py", line 187, in RT
  \__swig_destroy__ = _myobjects.delete_RT
  AttributeError: 'module' object has no attribute 'delete_RT'
  </code></pre>
  
  <p>myobjects.py swig generated code of RT looks like this:</p>
  
  <pre><code>class RT(_object):
      __swig_setmethods__ = {}
      __setattr__ = lambda self, name, value: _swig_setattr(self, RT, name, value)
      __swig_getmethods__ = {}
      __getattr__ = lambda self, name: _swig_getattr(self, RT, name)
      __repr__ = _swig_repr
      def __init__(self, *args):
          this = _myobjects.new_RT(*args)
          try: self.this.append(this)
          except: self.this = this
      def getName(self): return _myobjects.RT_getName(self)
      __swig_destroy__ = _myobjects.delete_RT
      __del__ = lambda self : None;
  </code></pre>
  
  <p>And the cxx file from which _myobjects.so is created has the following lines:</p>
  
  <pre><code>SWIGINTERN PyObject *_wrap_delete_RT(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
    PyObject *resultobj = 0;
    RT *arg1 = (RT *) 0 ;
  ...
  </code></pre>
  
  <p>In short, all appears in order but we still get the python error. </p>
  
  <p>Any ideas anyone?</p>
  
  <p>Thanks,</p>
  
  <p>Tomer</p>