[Pyrex] Total newbie needs code review

Chris Stromberger chris.stromberger at gmail.com
Fri Sep 9 16:53:28 CEST 2005


> Second, be aware that when assigning python strings to char pointers in
> Pyrex the reference returned points to the memory where the python string is
> stored. This memory should not be modified external to calls using the
> python/c api so any functions that modify it must malloc the string pointer
> and copy the python string into it instead. 

I guess this is why pyrex says "Obtaining char * from temporary Python
value" when I compile the pyx?

What is the proper way then to handle the strings in the pyx code?

Thanks,
Chris



More information about the Pyrex mailing list