summaryrefslogtreecommitdiff
path: root/numpy/core/records.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2020-03-26 17:50:20 +0000
committerGitHub <noreply@github.com>2020-03-26 12:50:20 -0500
commit1c58504eec43f9ba18ac835131fed496fb59772d (patch)
tree4ffc786c9cdac81887680aa999ae6dcbd4bd407d /numpy/core/records.py
parent5ff70eb0fd61a39207d5166479507e1b099cb707 (diff)
downloadnumpy-1c58504eec43f9ba18ac835131fed496fb59772d.tar.gz
MAINT: simplify code that assumes str/unicode and int/long are different types (#15816)
Cleanup from the dropping of python 2
Diffstat (limited to 'numpy/core/records.py')
-rw-r--r--numpy/core/records.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/core/records.py b/numpy/core/records.py
index ddefa5881..b1ee1aa11 100644
--- a/numpy/core/records.py
+++ b/numpy/core/records.py
@@ -40,7 +40,7 @@ from collections import Counter, OrderedDict
from . import numeric as sb
from . import numerictypes as nt
from numpy.compat import (
- isfileobj, bytes, long, unicode, os_fspath, contextlib_nullcontext
+ isfileobj, os_fspath, contextlib_nullcontext
)
from numpy.core.overrides import set_module
from .arrayprint import get_printoptions
@@ -188,7 +188,7 @@ class format_parser:
if names:
if type(names) in [list, tuple]:
pass
- elif isinstance(names, (str, unicode)):
+ elif isinstance(names, str):
names = names.split(',')
else:
raise NameError("illegal input names %s" % repr(names))
@@ -703,7 +703,7 @@ def fromrecords(recList, dtype=None, shape=None, formats=None, names=None,
shape = _deprecate_shape_0_as_None(shape)
if shape is None:
shape = len(recList)
- if isinstance(shape, (int, long)):
+ if isinstance(shape, int):
shape = (shape,)
if len(shape) > 1:
raise ValueError("Can only deal with 1-d array.")
@@ -792,7 +792,7 @@ def fromfile(fd, dtype=None, shape=None, offset=0, formats=None,
if shape is None:
shape = (-1,)
- elif isinstance(shape, (int, long)):
+ elif isinstance(shape, int):
shape = (shape,)
if isfileobj(fd):