Meta-class inheritance problem (Python2.0 bug?)

Lorien Dunn loriendNOSPAM at bigpond.com
Sat Mar 17 01:38:22 EST 2001


I've located the point in the python 2.0 code where this occurs, so my 
question is now: 

        What needs to be changed to make this wotk with meta-classes as well?:

ceval.c, line 1816 (reformatted for clarity):

/*              BEGIN CODE SAMPLE                       */ 

else 
{
        /* Unbound methods must be called with an instance of the class (or a                                   
        derived class) as first argument */
        if (na > 0 && (self = stack_pointer[-n]) != NULL 
                && PyInstance_Check(self)
                && PyClass_IsSubclass((PyObject *) (((PyInstanceObject*)                                                                                                                                        
                self)->in_class), class))
                         /* Handy-dandy */ ;
        else 
        {
                PyErr_SetString(PyExc_TypeError,
                        "unbound method must be called with class
                         instance 1st argument");
                x = NULL;
                break;
        }
}

/*              END CODE SAMPLE         */


Lorien

                   




More information about the Python-list mailing list