Thinker wrote:

> Since PyArg_ParseTuple() is supposed to parse arguments, I recommand you
> to use PyTuple_GetItem() or PyTuple_GET_ITEM().

Ok.  Now I do it this way:

c_real = PyFloat_AsDouble(PyTuple_GetItem(coord,0));
c_imag = PyFloat_AsDouble(PyTuple_GetItem(coord,1));

And it worked... once.  The problem is really funny - in the interactive
the function fails every second time.

>>> mandelpixel((1.5, 1.5), 9, 2.2)
args parsed
coord parsed
ii3
>>> mandelpixel((1.5, 1.5), 9, 2.2)
TypeError: bad argument type for built-in operation
>>> mandelpixel((1.5, 1.5), 9, 2.2)
args parsed
coord parsed
ii3
>>> mandelpixel((1.5, 1.5), 9, 2.2)
TypeError: bad argument type for built-in operation

etcaetera.... (the "args parsed" "coord parsed" and "i" are effect of
printfs in the code, as you see when it fails, it doesn't even manage to
parse the arguments.

zefciu
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to