[Xapian-discuss] Python bindings...
James Aylett
james-xapian at tartarus.org
Thu Sep 1 11:20:35 BST 2005
On Wed, Aug 31, 2005 at 07:40:01PM +0100, Olly Betts wrote:
> I was hoping James would have a chance to look at it, since he seems to
> understand the swig python stuff best.
>
> James: If you're too busy, or had a look and didn't get anywhere, let me
> kmow abnd I'll see what I can do...
Previously I was usually able to get this sort of thing working with a
bit of judicious juggling of things, but I'm having difficulty this
time. It seems to be a problem that SWIG isn't completely recognising
the 'const' modifier on const std::vector<std::string> * (for which we
have a custom typemap), or const std::vector<std::string> & (for which
there is a shipped one, allegedly). I just can't get either working
now - the former claims:
----------------------------------------------------------------------
/s1/james/projects/xapian/xapian/xapian-bindings/python/../xapian.i:785:
Warning(467): Overloaded
Xapian::Query(std::vector<std::string,std::allocator<std::string > >
const *subqs) not supported (no type checking rule for
'std::vector<std::string,std::allocator<std::string > > const *').
----------------------------------------------------------------------
when there is (it's in python/util.i, I've modified it to get the
signature identical in terms of 'const' keyword position).
With the former, SWIG will run happily and produce rubbish that
doesn't both running the typecheck or in typemaps. typecheck is needed
in the overloading of new_Query(), which is why this doesn't work.
I'm building the latest SWIG HEAD, but in my experience the SWIG team
doesn't actually care about these kinds of problems - they come and go
with no apparent effort on their part. This probably means that we're
using it wrongly, but I can't figure out how...
J
--
/--------------------------------------------------------------------------\
James Aylett xapian.org
james at tartarus.org uncertaintydivision.org
More information about the Xapian-discuss
mailing list