>>> result.index(2)
Traceback (most recent call last):
File "<input>", line 1, in <module>
AttributeError: 'gobject.GBoxed' object has no attribute '__module__'. Did you mean: '__reduce__'?
The PDB works well (the function you use instead uses the PDB), it’s the binding which likely doesn’t know how to handle such boxed types. There may be something fixable on our side, or maybe not. Sometimes it needs to be fixed on the binding side (PyGObject for Python). Can’t say for sure. We’d need to look at such things more closely.
In any case, there are usually no reasons whatsoever to use the PDB directly for any of the libgimp functions. The latter are much more practical to use.
The PDB are much more useful for all PDB procedures which don’t have an associated function, i.e. all the PDB procedures created by plug-ins (allowing one plug-in to call another).