emulating sequences

John Hunter jdhunter at nitace.bsd.uchicago.edu
Sun Sep 2 17:00:19 CEST 2001


>>>>> "Hans" == Hans Nowak <hnowak at cuci.nl> writes:

    Hans> Can't help you there... I don't know much about extensions
    Hans> in C++. :( Maybe Alex Martelli does...?

I read a little bit about this in the Python Extension building
docs.  Basically, this works by setting a global var, as in 
  
 if ( i>=v.size()) {
  PyErr_SetString(PyExc_IndexError, "index out of range");
  return NULL;
 }
 return v[i];

But for it does not appear to be working just right for me yet
(returning NULL is causing a problem for some of my vector types
because the elements cannot be initialized with an int).  I'll poke
around the docs some more for a solution.

Thanks,
JDH



More information about the Python-list mailing list