A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/068478.html below:

PyArg_Parse weirds

PyArg_Parse weirdsRobin Becker robin at jessikat.fsnet.co.uk
Tue Apr 24 05:28:38 EDT 2001
can someone jog my cpu to solve a problem with this C fragment

        else if(PyObject_HasAttrString(value,"red")
                        && PyObject_HasAttrString(value,"green")
                        && PyObject_HasAttrString(value,"blue")){
                double  r, g, b;
                PyObject *v, *s;
                printf("object seen\n");
                v = PyObject_GetAttrString(value,"red");
                i = PyArg_Parse(v,"d",&r);
                s = PyObject_Str(v);
                printf("v=%8.8X=%s i=%d r=%g\n", v, PyString_AsString(s), i, r);
                Py_DECREF(s);
                Py_DECREF(v);


when run I see

object seen
v=008213B8=0.0 i=0 r=8.23537e-164

so I'm getting the attribute ok and it is a float (checked in python) so why does my 
PyArg_Parse of v fail?
-- 
Robin Becker

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4