0

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?

Azat Ibrakov
  • 9,998
  • 9
  • 38
  • 50
PintoDoido
  • 1,011
  • 16
  • 35

1 Answers1

1

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

user590028
  • 11,364
  • 3
  • 40
  • 57