diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2018-01-17 00:50:49 -0800 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2018-01-17 01:02:40 -0800 |
commit | 669e87af8f2fdda9f17ad221a0e8cc1fd91c5a0e (patch) | |
tree | ad25d03e63aadce0cc02cbc93951d32b34db1be4 /numpy/core/include | |
parent | 5f01e54b20e38d483e8bab31bf5f953a860fe8d3 (diff) | |
download | numpy-669e87af8f2fdda9f17ad221a0e8cc1fd91c5a0e.tar.gz |
MAINT: Remove repeated #ifdefs implementing `isinstance(x, basestring)` for field names
Diffstat (limited to 'numpy/core/include')
-rw-r--r-- | numpy/core/include/numpy/npy_3kcompat.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/include/numpy/npy_3kcompat.h b/numpy/core/include/numpy/npy_3kcompat.h index c0aa1eb2e..56fbd99af 100644 --- a/numpy/core/include/numpy/npy_3kcompat.h +++ b/numpy/core/include/numpy/npy_3kcompat.h @@ -94,6 +94,8 @@ static NPY_INLINE int PyInt_Check(PyObject *op) { #define PyUString_InternFromString PyUnicode_InternFromString #define PyUString_Format PyUnicode_Format +#define PyBaseString_Check(obj) (PyUnicode_Check(obj)) + #else #define PyBytes_Type PyString_Type @@ -123,6 +125,8 @@ static NPY_INLINE int PyInt_Check(PyObject *op) { #define PyUString_InternFromString PyString_InternFromString #define PyUString_Format PyString_Format +#define PyBaseString_Check(obj) (PyBytes_Check(obj) || PyUnicode_Check(obj)) + #endif /* NPY_PY3K */ |