I am using Shiboken to wrap a small class library. In my typesystem.xml file, I have added a __nonzero__() method to some of the classes using the <add-function> element. The method gets generated OK and I can call it from python, however, python is *not* calling the Shiboken-generated __nonzero__() method when doing truth value testing, for example, in an "if object:" expression.
Looking briefly at the Shiboken source, in particular, CppGenerator::hasBoolCast(), I get the impression that I *must* use the --use-isnull-as-nb_nonzero command-line option in order to get the expected boolean value. My tests further indicate that this option only applies to isNull() methods that are implemented in the C++ classes, not added via the typesystem file. Is this correct?
_______________________________________________ PySide mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/pyside
