summaryrefslogtreecommitdiff
path: root/numpy/core/_internal.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/_internal.py')
-rw-r--r--numpy/core/_internal.py16
1 files changed, 1 insertions, 15 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py
index 260381e85..749e63432 100644
--- a/numpy/core/_internal.py
+++ b/numpy/core/_internal.py
@@ -230,21 +230,7 @@ def _array_descr(descriptor):
if fields is None:
return descriptor.dtypestr
- #get ordered list of fields with names
- ordered_fields = fields.items()
- # remove duplicates
- new = {}
- for item in ordered_fields:
- # We don't want to include redundant or non-string
- # entries
- if not isinstance(item[0],str) or (len(item[1]) > 2 \
- and item[0] == item[1][2]):
- continue
- new[item[1]] = item[0]
- ordered_fields = [x[0] + (x[1],) for x in new.items()]
- #sort the list on the offset
- ordered_fields.sort(lambda x,y : cmp(x[1],y[1]))
-
+ ordered_fields = [fields[x] + (x,) for x in fields[-1]]
result = []
offset = 0
for field in ordered_fields: