@@ -44,14 +44,14 @@ cdef extern from "numpy/npy_common.h":
44
44
int64_t NPY_MIN_INT64
45
45
46
46
47
- cdef inline int64_t get_nat():
47
+ cdef inline int64_t get_nat() noexcept :
48
48
return NPY_MIN_INT64
49
49
50
50
51
51
# --------------------------------------------------------------------
52
52
# Type Checking
53
53
54
- cdef inline bint is_integer_object(object obj) nogil:
54
+ cdef inline bint is_integer_object(object obj) noexcept nogil:
55
55
"""
56
56
Cython equivalent of
57
57
@@ -73,7 +73,7 @@ cdef inline bint is_integer_object(object obj) nogil:
73
73
and not is_timedelta64_object(obj))
74
74
75
75
76
- cdef inline bint is_float_object(object obj) nogil:
76
+ cdef inline bint is_float_object(object obj) noexcept nogil:
77
77
"""
78
78
Cython equivalent of `isinstance(val, (float, np.float_))`
79
79
@@ -89,7 +89,7 @@ cdef inline bint is_float_object(object obj) nogil:
89
89
(PyObject_TypeCheck(obj, & PyFloatingArrType_Type)))
90
90
91
91
92
- cdef inline bint is_complex_object(object obj) nogil:
92
+ cdef inline bint is_complex_object(object obj) noexcept nogil:
93
93
"""
94
94
Cython equivalent of `isinstance(val, (complex, np.complex_))`
95
95
@@ -105,7 +105,7 @@ cdef inline bint is_complex_object(object obj) nogil:
105
105
PyObject_TypeCheck(obj, & PyComplexFloatingArrType_Type))
106
106
107
107
108
- cdef inline bint is_bool_object(object obj) nogil:
108
+ cdef inline bint is_bool_object(object obj) noexcept nogil:
109
109
"""
110
110
Cython equivalent of `isinstance(val, (bool, np.bool_))`
111
111
@@ -121,11 +121,11 @@ cdef inline bint is_bool_object(object obj) nogil:
121
121
PyObject_TypeCheck(obj, & PyBoolArrType_Type))
122
122
123
123
124
- cdef inline bint is_real_number_object(object obj) nogil:
124
+ cdef inline bint is_real_number_object(object obj) noexcept nogil:
125
125
return is_bool_object(obj) or is_integer_object(obj) or is_float_object(obj)
126
126
127
127
128
- cdef inline bint is_timedelta64_object(object obj) nogil:
128
+ cdef inline bint is_timedelta64_object(object obj) noexcept nogil:
129
129
"""
130
130
Cython equivalent of `isinstance(val, np.timedelta64)`
131
131
@@ -140,7 +140,7 @@ cdef inline bint is_timedelta64_object(object obj) nogil:
140
140
return PyObject_TypeCheck(obj, & PyTimedeltaArrType_Type)
141
141
142
142
143
- cdef inline bint is_datetime64_object(object obj) nogil:
143
+ cdef inline bint is_datetime64_object(object obj) noexcept nogil:
144
144
"""
145
145
Cython equivalent of `isinstance(val, np.datetime64)`
146
146
@@ -155,7 +155,7 @@ cdef inline bint is_datetime64_object(object obj) nogil:
155
155
return PyObject_TypeCheck(obj, & PyDatetimeArrType_Type)
156
156
157
157
158
- cdef inline bint is_array(object val):
158
+ cdef inline bint is_array(object val) noexcept :
159
159
"""
160
160
Cython equivalent of `isinstance(val, np.ndarray)`
161
161
@@ -217,11 +217,11 @@ cdef inline const char* get_c_string(str py_string) except NULL:
217
217
return get_c_string_buf_and_size(py_string, NULL )
218
218
219
219
220
- cdef inline bytes string_encode_locale(str py_string):
220
+ cdef inline bytes string_encode_locale(str py_string) noexcept :
221
221
""" As opposed to PyUnicode_Encode, use current system locale to encode."""
222
222
return PyUnicode_EncodeLocale(py_string, NULL )
223
223
224
224
225
- cdef inline object char_to_string_locale(const char * data):
225
+ cdef inline object char_to_string_locale(const char * data) noexcept :
226
226
""" As opposed to PyUnicode_FromString, use current system locale to decode."""
227
227
return PyUnicode_DecodeLocale(data, NULL )
0 commit comments