I am working in Cython, and I need to use Python's int type, not C's int type. How do I declare a Cython variable to be a Python-style integer?
cdef int x will use a C-style integer, not a Python-style integer.
cdef object x can store a Python-style integer, but it will be slow due to redundant runtime type checking.
If I know 100% that an object is going to be an int, can I avoid the runtime type checks?
The Cython docs seem to indicate that declaring it as object is the best that we can do, and we just have to live with the redundancy. This feels uncharacteristic of Cython, and I'm not fully convinced that I'm interpreting the documentation correctly.
Is is even possible to do what I'm asking?