tp_getattrfunc, access members that are a list

Torsten Mohr tmohr at
Tue Jun 8 10:27:57 CEST 2004

>> Can anybody describe me how i can access the array d[8]
>> as a list?  I'd like to get AND set values in there.
> I don't think you can expose them as a list, but you should look into
> structmember.h, and it's PyMemberDef to expose the items separately.


i've looked into structmember.h, but nothing (like e.g. a flag)
can mark that member as an array.
Also, i can't just export every single array member, as i need
to access them indexed, e.g. in a for() for clearing, for
setting calculated values, ...

In the documentation i read that accessing arrays should be done
by getattr/setattr functions.  This must be possible somehow...

Best regards,

More information about the Python-list mailing list