This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author philthompson10
Recipients
Date 2004-09-24.16:33:41
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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. 
History
Date User Action Args
2007-08-23 14:26:26adminlinkissue1034178 messages
2007-08-23 14:26:26admincreate