[Python-bugs-list] [ python-Bugs-681367 ] C subtypes do not inherit tp_as_buffer

SourceForge.net noreply@sourceforge.net
Wed, 05 Feb 2003 16:25:39 -0800


Bugs item #681367, was opened at 2003-02-05 15:23
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=681367&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Greg Chapman (glchapman)
Assigned to: Nobody/Anonymous (nobody)
Summary: C subtypes do not inherit tp_as_buffer

Initial Comment:
Subtypes of str (for example) implemented in C do not 
inherit str's tp_as_buffer funcs unless the subtypes provide 
a pointer to a tp_as_buffer structure in their type struct.  
This is different from how the other method suites 
(tp_as_sequence, etc.) are handled; near the end of 
PyType_Ready the other method suites are copied from 
the base into the subtype if the subtype's slot is NULL.  

It looks like the tp_as_buffer omission is simply an 
oversight, since the flag manipulations in inherit_special 
appear to be preparing the way for copying the base 
pointer into the subtype.  So I've attached a small patch 
(against the 2.3a1 version of typeobject.c) to fix this.


----------------------------------------------------------------------

>Comment By: Greg Chapman (glchapman)
Date: 2003-02-05 15:25

Message:
Logged In: YES 
user_id=86307

aargh -- the patch didn't get attached; trying again.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=681367&group_id=5470