[Python-Dev] C basetype mapping protocol difference between 2.2.1 and 2.3

Todd Miller jmiller@stsci.edu
Fri, 09 Aug 2002 10:46:57 -0400


I am trying to accelerate Numarray by "dropping the bottom out" and 
re-writing the simplest, most used portions in a  C basetype.  Looking 
at a new NumArray instance in Python-2.2.1 under GDB, I see:

(gdb) p *self->ob_type->tp_as_mapping
$2 = {mp_length = 0x4006eb7c <_ndarray_length>, mp_subscript = 0x80669b8 
<slot_mp_subscript>,
mp_ass_subscript = 0x80669e0 <slot_mp_ass_subscript>}

Looking at the same code compiled for Python-2.3, _ndarray "owns" all of 
the mapping protocol slots, which is what I really want to happen:    

(gdb) p *o->ob_type->tp_as_mapping
$1 = {mp_length = 0x400c1a68 <_ndarray_length>, mp_subscript = 
0x400c1a80 <_ndarray_subscript>, mp_ass_subscript = 0x400c1188 
<_ndarray_ass_subscript>}

Did anything change between Python-2.2.1 and Python-2.3 that would 
account for this?

Todd

-- 
Todd Miller 			jmiller@stsci.edu
STSCI / SSG