[GNC-dev] Problems with python 3 and the gnucash python bindings.

John Ralls jralls at ceridwen.us
Mon Jul 16 13:47:33 EDT 2018



> On Jul 16, 2018, at 10:09 AM, Derek Atkins <warlord at MIT.EDU> wrote:
> 
> John Ralls <jralls at ceridwen.us> writes:
> 
>>> When it moves to C++ you can just use std::string.  :)
>> 
>> An enum would be safer, faster, smaller, more intuitive, and wouldn’t
>> break swig.
> 
> Funny...  15+ years ago it WAS an Enum, but changed to a string because
> we wanted to enable searching on plug-in modules.

OK, and enums are immune to run-time changes implied by a plugin module, but there are better ways than strings to tag types. Glib provides Gquarks for just this purpose and even provides a function to get one on a GObject's type name:
g_type_qname(G_OBJECT_TYPE()).

C++ obviously has a different type model and we'll need to rework/replace QofID, QofContainer, and QofQuery to match it so changing them now to use quarks instead of strings would be wasted effort.

Regards,
John Ralls




More information about the gnucash-devel mailing list