summaryrefslogtreecommitdiff
path: root/numpy/lib/format.py
diff options
context:
space:
mode:
authormattip <matti.picus@gmail.com>2019-05-05 19:50:06 -0400
committermattip <matti.picus@gmail.com>2019-05-11 16:37:34 -0700
commitbd73a15363295658e150754edf6d1073cbdb3975 (patch)
tree60fc02fecc77059ee1b9602477795cc21fa18e1c /numpy/lib/format.py
parentb90addd13f17d967d81dc1d7515887d4fcd6ef59 (diff)
downloadnumpy-bd73a15363295658e150754edf6d1073cbdb3975.tar.gz
MAINT: remove uneeded code
Diffstat (limited to 'numpy/lib/format.py')
-rw-r--r--numpy/lib/format.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/numpy/lib/format.py b/numpy/lib/format.py
index 05fcbc0bc..86f71eda9 100644
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -267,15 +267,13 @@ def descr_to_dtype(descr):
This function reverses the process, eliminating the empty padding fields.
'''
- if isinstance(descr, (str, dict)):
+ if isinstance(descr, str):
# No padding removal needed
return numpy.dtype(descr)
elif isinstance(descr, tuple):
- if isinstance(descr[0], list):
- # subtype, will always have a shape descr[1]
- dt = descr_to_dtype(descr[0])
- return numpy.dtype((dt, descr[1]))
- return numpy.dtype(descr)
+ # subtype, will always have a shape descr[1]
+ dt = descr_to_dtype(descr[0])
+ return numpy.dtype((dt, descr[1]))
fields = []
offset = 0
for field in descr: