@@ -25,7 +25,6 @@ from cpython.object cimport (
25
25
Py_EQ,
26
26
PyObject,
27
27
PyObject_RichCompareBool,
28
- PyTypeObject,
29
28
)
30
29
from cpython.ref cimport Py_INCREF
31
30
from cpython.sequence cimport PySequence_Check
@@ -67,10 +66,6 @@ from numpy cimport (
67
66
68
67
cnp.import_array()
69
68
70
- cdef extern from " Python.h" :
71
- # Note: importing extern-style allows us to declare these as nogil
72
- # functions, whereas `from cpython cimport` does not.
73
- bint PyObject_TypeCheck(object obj, PyTypeObject* type ) nogil
74
69
75
70
cdef extern from " numpy/arrayobject.h" :
76
71
# cython's numpy.dtype specification is incorrect, which leads to
@@ -89,9 +84,6 @@ cdef extern from "numpy/arrayobject.h":
89
84
object fields
90
85
tuple names
91
86
92
- PyTypeObject PySignedIntegerArrType_Type
93
- PyTypeObject PyUnsignedIntegerArrType_Type
94
-
95
87
cdef extern from " pandas/parser/pd_parser.h" :
96
88
int floatify(object , float64_t * result, int * maybe_int) except - 1
97
89
void PandasParser_IMPORT()
@@ -1437,14 +1429,12 @@ cdef class Seen:
1437
1429
self .sint_ = (
1438
1430
self .sint_
1439
1431
or (oINT64_MIN <= val < 0 )
1440
- # Cython equivalent of `isinstance(val, np.signedinteger)`
1441
- or PyObject_TypeCheck(val, & PySignedIntegerArrType_Type)
1432
+ or isinstance (val, cnp.signedinteger)
1442
1433
)
1443
1434
self .uint_ = (
1444
1435
self .uint_
1445
1436
or (oINT64_MAX < val <= oUINT64_MAX)
1446
- # Cython equivalent of `isinstance(val, np.unsignedinteger)`
1447
- or PyObject_TypeCheck(val, & PyUnsignedIntegerArrType_Type)
1437
+ or isinstance (val, cnp.unsignedinteger)
1448
1438
)
1449
1439
1450
1440
@property
0 commit comments