diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2020-01-23 16:50:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-23 16:50:25 -0800 |
commit | 68224f43d09393c1981bb83ee3c13a5158d2817c (patch) | |
tree | 94153dd189f924c399c2621c325fd2fd2a5e6ba6 /numpy/core/einsumfunc.py | |
parent | 4c32890b3628434996824ae2056333b9a389f46c (diff) | |
parent | b4e3a4227e3a9cfe28717db458e67d79e916a418 (diff) | |
download | numpy-68224f43d09393c1981bb83ee3c13a5158d2817c.tar.gz |
Merge pull request #15407 from charris/replace-basestring
MAINT: Replace basestring with str.
Diffstat (limited to 'numpy/core/einsumfunc.py')
-rw-r--r-- | numpy/core/einsumfunc.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/numpy/core/einsumfunc.py b/numpy/core/einsumfunc.py index ec3eb19d2..342fbbbe1 100644 --- a/numpy/core/einsumfunc.py +++ b/numpy/core/einsumfunc.py @@ -4,7 +4,6 @@ Implementation of optimized einsum. """ import itertools -from numpy.compat import basestring from numpy.core.multiarray import c_einsum from numpy.core.numeric import asanyarray, tensordot from numpy.core.overrides import array_function_dispatch @@ -550,7 +549,7 @@ def _parse_einsum_input(operands): if len(operands) == 0: raise ValueError("No input operands") - if isinstance(operands[0], basestring): + if isinstance(operands[0], str): subscripts = operands[0].replace(" ", "") operands = [asanyarray(v) for v in operands[1:]] @@ -820,7 +819,7 @@ def einsum_path(*operands, optimize='greedy', einsum_call=False): memory_limit = None # No optimization or a named path algorithm - if (path_type is False) or isinstance(path_type, basestring): + if (path_type is False) or isinstance(path_type, str): pass # Given an explicit path @@ -828,7 +827,7 @@ def einsum_path(*operands, optimize='greedy', einsum_call=False): pass # Path tuple with memory limit - elif ((len(path_type) == 2) and isinstance(path_type[0], basestring) and + elif ((len(path_type) == 2) and isinstance(path_type[0], str) and isinstance(path_type[1], (int, float))): memory_limit = int(path_type[1]) path_type = path_type[0] |