Using set_rebind_proc(func) with a bound method

David Leonard david.leonard at csee.uq.edu.au
Sun Jun 3 06:15:52 CEST 2001


On Fri, 1 Jun 2001, f.glasner at feldmann-mg.com typed thusly:

> But there is no reason why this "callback" should only work
> with "normal" functions in Python.

> -    if ( PyFunction_Check(func) ) {
> +    if ( PyCallable_Check(func) ) {
>
> -    PyErr_SetString( PyExc_TypeError, "expected function or None" );
> +    PyErr_SetString( PyExc_TypeError, "expected function, bound method or None" );


you are absoluetly correct
I will add this patch

> +        Py_XDECREF(rebind_callback_func);
> +        Py_INCREF(func);
> +        Py_XDECREF(rebind_callback_func);

and this one after i look at it more carefully..

d
-- 
David Leonard                           David.Leonard at dstc.edu.au
DSTC                                    Room:78-632  Ph:+61 7 336 58358
The University of Queensland            http://www.dstc.edu.au/
QLD 4072  AUSTRALIA                     B73CD65FBEF4C089B79A8EBADF1A932F13EA0FC8

I put my chin on my knee, and looked for flaws in the soft grain of my
beige plastic monitor casing. - Julian Assange






More information about the python-ldap mailing list