[gdal-dev] Some questions about the TransformPoints typemap
r.hogendoorn at hitt.nl
Thu Jun 4 08:51:40 EDT 2009
In 1.6.1, TransformPoints got a python typemap such that a list of tuples can be transformed.
I want to make it a little bit more general, such that the inner tuples can be lists as well.
While looking at the typemap, I have the following questions:
- Why is there an explicit check on Py_None? Py_None will fail the next test anyway and the
error message is not entirely true since a tuple is a sequence as well (and works).
- Memory is allocated with CPLMalloc; in some other typemaps it is plain malloc. In the latter
case, there is no check on allocation failures. Should these be replaced by CPLMalloc?
- If CPLMalloc fails, it calls a memory allocation failure hook (according to the docs). The
default is to terminate the application; shouldn't this hook raise a python memory exception?
- The transformpoints typemap returns a tuple of 2 lists. In general, python functions return
tuples. Is there a reason to return lists in this case?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gdal-dev