Haven't used them myself yet. So you can use them to
expose all of the C-API? Cool!
Yes, ctypes.pythonapi exposes the Python C API to Python.
You can use it for evil code like this hack to prevent thread switch
(doesn't work with Python 3, as the implementation has changed).
Just make sure you don't call extension code that releases the GIL,
or all bets are off ;-)
Sturla
from contextlib import contextmanager
import ctypes
_Py_Ticker = ctypes.c_int.in_dll(ctypes.pythonapi,"_Py_Ticker")