[Xapian-devel] Bindings and overloading

Alex Bowley alex-xapian at hyperspeed.org
Thu Jun 3 14:38:40 BST 2004


On Thu, Jun 03, 2004 at 01:38PM, James Aylett wrote:
> The way overloading works in SWIG is to create /one/ method with
> either *args or **kwargs as the formal parameter tail, and then doing
> parameter type recognition in there.
> 
> Several of the Query constructors work fine for me in python. Which
> ones are giving you problems? (And do you mean 'prints errors', or
> 'throws exceptions'?)

The constructor that takes any number of Querys of strings, demarked by
iterators: http://www.xapian.org/docs/apidoc/html/classXapian_1_1Query.html#a7

It prints errors like the following:

sh-2.05b$ python test-xapian3.py
Traceback (most recent call last):
 File "test-xapian3.py", line 30, in ?
   q3=xapian.Query(xapian.Query.OP_PHRASE,'bodega','sell','fish')
 File
"/lmn/tools/search/python/python-2.3.3/lib/python2.3/site-packages/xapian.py",
line 452, in __init__
   _swig_setattr(self, Query, 'this', _xapian.new_Query(*args))
TypeError: No matching function for overloaded 'new_Query'


> > Are these changes available in CVS?
> 
> Which changes?

Wrapping the above mentioned constructor.

-- 
Alex Bowley                                           http://hyperspeed.org/
"Computer games don't affect kids; I mean if Pac-Man had affected us as
 kids, we'd all be running around darkened rooms, munching magic pills and
 listening to repetitive electronic music."
                                      - Kristian Wilson, Nintendo, Inc. 1989




More information about the Xapian-devel mailing list