tp_getattrfunc, access members that are a list

From: Torsten Mohr (tmohr_at_s.netic.de)
Date: 06/07/04


Date: Mon, 07 Jun 2004 22:28:06 +0200

Hi,

in the documentation and the examples that describe how to
make the members of a new type accessible it says that
i need to use the getattrfunc and setattrfunc if i want
to access members that are an array.

typedef struct {
  PyObject_HEAD
  unsigned char d[8];
} pmod_obj;

Sadly i did not find any example on how to do this.

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.

Thanks for any hints,
Torsten.



Relevant Pages

  • Re: visibility matter on converting object to array
    ... i'll get an array having keys that from member variable's name ... i guessed "i can get public members but not protected, private, static ... Is it right way to access object members?(by converting to ...
    (comp.lang.php)
  • Re: Properties
    ... Instead of properties I would prefer a full abstraction of record, array, ... members and privately implement it as another record with other members or ... private array of Character; ...
    (comp.lang.ada)
  • Re: Array Design
    ... ITOH it's pretty sure you are referencing an element in the array that you ... > When the application starts I initialise a state class, ... > I ask the user how many members to create. ... >>> have exceptions cropping up. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: extract items from list in single field
    ... Try using the Splitfunction to change the delimited string into an array. ... You would then loop through the members of the array and write one record to ...
    (microsoft.public.access.modulesdaovba)
  • Re: how to make a variable based on array length and member value
    ... I have an array full_arrayof an arbitrary number of transaction ... From the array I have created a new array years.uniq! ... what id like to do is take the new arrays members and use them as ... will fail, because you HAVE NOT YET WRITTEN THE CODE. ...
    (comp.lang.ruby)