File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,24 @@ int PANDAS_INLINE complexobject_cmp(PyObject* a, PyObject* b){
190
190
);
191
191
}
192
192
193
+ int PANDAS_INLINE pyobject_cmp (PyObject * a , PyObject * b );
194
+
195
+
196
+ int PANDAS_INLINE tupleobject_cmp (PyObject * a , PyObject * b ){
197
+ Py_ssize_t i ;
198
+
199
+ if (Py_SIZE (a ) != Py_SIZE (b )) {
200
+ return 0 ;
201
+ }
202
+
203
+ for (i = 0 ; i < Py_SIZE (a ); ++ i ) {
204
+ if (!pyobject_cmp (PyTuple_GET_ITEM (a , i ), PyTuple_GET_ITEM (b , i ))) {
205
+ return 0 ;
206
+ }
207
+ }
208
+ return 1 ;
209
+ }
210
+
193
211
194
212
int PANDAS_INLINE pyobject_cmp (PyObject * a , PyObject * b ) {
195
213
int result = PyObject_RichCompareBool (a , b , Py_EQ );
@@ -207,6 +225,9 @@ int PANDAS_INLINE pyobject_cmp(PyObject* a, PyObject* b) {
207
225
if (PyComplex_CheckExact (a )) {
208
226
return complexobject_cmp (a , b );
209
227
}
228
+ if (PyTuple_CheckExact (a )) {
229
+ return tupleobject_cmp (a , b );
230
+ }
210
231
}
211
232
return result ;
212
233
}
You can’t perform that action at this time.
0 commit comments