Message22540
I have a new-style class implemented in C which defines slots
(eg. puts a C function pointer in mp_length). It does not create a
__len__ entry in the class dictionary. If I sub-class it in Python
then the slot is not inherited.
The function pointer is copied correctly by inherit_slots() (in
typeobject.c). The problem occurs in update_one_slot(). The call
to _PyType_Lookup() fails because the slot does not have an
entry in the class dictionary. This causes the valid function
pointer to be overwritten with the value of "specific" which is 0.
The following patch fixes the problem - but I'm not sure it is the
correct fix. |
|
Date |
User |
Action |
Args |
2007-08-23 14:26:26 | admin | link | issue1034178 messages |
2007-08-23 14:26:26 | admin | create | |
|