Comment 1 for bug 962168

Revision history for this message
Johan RĂ¥de (johan-rade) wrote :

I took a look at the C code generated by PyBindGen.
(Fortunately PyBindGen generated exceptionally readable code.)
There I could see that my __nonzero__ method was added to the tp_methods member of the type object.
It should have been added as the nb_nonzero member of the tp_as_number member of the type object; see
http://docs.python.org/c-api/typeobj.html#number-object-structures

So it seems that either I have added __nonzero__ the wrong way, or this is a PyBindGen bug.