diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2020-01-23 14:44:36 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2020-01-23 14:56:57 -0700 |
commit | b4e3a4227e3a9cfe28717db458e67d79e916a418 (patch) | |
tree | f8e78724985f104bb6302d5a36d4e9a0799f0ca1 /numpy/lib/recfunctions.py | |
parent | 11654979194d7d17b78cee08f4a26877acd5071b (diff) | |
download | numpy-b4e3a4227e3a9cfe28717db458e67d79e916a418.tar.gz |
MAINT: Replace basestring with str.
This replaces basestring with str except in
- tools/npy_tempita/
- numpy/compat/py3k.py
Diffstat (limited to 'numpy/lib/recfunctions.py')
-rw-r--r-- | numpy/lib/recfunctions.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py index af4cfa09d..03c0c82f5 100644 --- a/numpy/lib/recfunctions.py +++ b/numpy/lib/recfunctions.py @@ -13,7 +13,6 @@ from numpy.ma import MaskedArray from numpy.ma.mrecords import MaskedRecords from numpy.core.overrides import array_function_dispatch from numpy.lib._iotools import _is_string_like -from numpy.compat import basestring from numpy.testing import suppress_warnings _check_fill_value = np.ma.core._check_fill_value @@ -299,7 +298,7 @@ def _izip_fields(iterable): """ for element in iterable: if (hasattr(element, '__iter__') and - not isinstance(element, basestring)): + not isinstance(element, str)): for f in _izip_fields(element): yield f elif isinstance(element, np.void) and len(tuple(element)) == 1: @@ -698,7 +697,7 @@ def append_fields(base, names, data, dtypes=None, if len(names) != len(data): msg = "The number of arrays does not match the number of names" raise ValueError(msg) - elif isinstance(names, basestring): + elif isinstance(names, str): names = [names, ] data = [data, ] # @@ -1455,7 +1454,7 @@ def join_by(key, r1, r2, jointype='inner', r1postfix='1', r2postfix='2', "'outer' or 'leftouter' (got '%s' instead)" % jointype ) # If we have a single key, put it in a tuple - if isinstance(key, basestring): + if isinstance(key, str): key = (key,) # Check the keys |