Reputation: 1051
I am trying to understand how to type check using python C-api.
To achieve this, I am studing the source code of GMPy, where they check if the argument
to a function is an integer using the macro IS_INTEGER(x)
, which itself is defined
based on a function PyInt_Check
.
However, I tried grep "PyInt_Check" -r
and I cannot
find the definition of PyInt_Check
in the source code.
What am I doing wrong? Shouldn't the definition of PyInt_Check
be on the GMPy folder?
Upvotes: 0
Views: 236
Reputation: 11730
PyInt_Check
is part of the python c-api, and you'll find it declared in your copy of python.h. You can read the details online https://docs.python.org/2.7/c-api/int.html#c.PyInt_Check
Upvotes: 1