Re: [capi-sig] Does Py_False or Py_True need de-referencing if used in a PyObject_Compare?

Dec. 17, 2012
1:59 p.m.
Take care using PyObject_IsTrue since it will accept many PyObject's (floats, lists, dicts etc), if you want to be strict with checking your input its not always so good. Instead you can use PyLong_AsLong() this works for True/False and any int type.
eg: int param = PyLong_AsLong(value); if (param == -1 && PyErr_Occurred()) { .... error out ... } ... check the int now ...
On Mon, Dec 17, 2012 at 10:23 PM, Gustavo Carneiro <gjcarneiro@gmail.com> wrote:
PyObject_IsTrue(
--
- Campbell
4452
Age (days ago)
4452
Last active (days ago)
0 comments
1 participants
participants (1)
-
Campbell Barton