Using GList types as a parameter via the Python bindings

Tom Lofts dev at
Sat Jun 1 04:24:33 EDT 2013

Hi there,

As part of some of work I've been doing relating the the Python bindings 
I've come across a number of functions which take a Glist data type.

I was originally attempting to work with the 
qof_query_add_guid_list_match function, but after encountering 
difficulties I've been testing with xaccSplitListGetUniqueTransactions 
which takes a Glist of splits and returns a Glist (presumably of 

So the following code:

print gnucash.gnucash_core_c.xaccSplitListGetUniqueTransactions(swig_splits)

But receive the error:

Traceback (most recent call last):
   File "./", line 420, in <module>
"/usr/local/lib/python2.7/dist-packages/gnucash/", line 
245, in xaccSplitListGetUniqueTransactions
     return _gnucash_core_c.xaccSplitListGetUniqueTransactions(*args)
TypeError: in method 'xaccSplitListGetUniqueTransactions', argument 1 of 
type 'GList const *'

I was assuming I'd be able to pass a Python list in as the parameter to 
this function and it would be correctly converted by SWIG into a GList 
as the reverse seems to happen on functions which return a GList such as 

Does anyone have any advice on what I may need to do to avoid this error 
or if some sort of change needs to be made to the SWIG interface?



More information about the gnucash-devel mailing list