summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2018-06-13 22:13:44 -0700
committerEric Wieser <wieser.eric@gmail.com>2018-06-13 22:19:54 -0700
commit0eb34b8f19b8585c53ebcdb6ed4d4d66aad7fa9b (patch)
treecd62e44f2c5c19df1da1b437f4dd187c35b172e1 /numpy
parent38e709522b754a2297b3119e7c80bf5811539fc7 (diff)
downloadnumpy-0eb34b8f19b8585c53ebcdb6ed4d4d66aad7fa9b.tar.gz
MAINT: Extract code present in both branches
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/numerictypes.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/numpy/core/numerictypes.py b/numpy/core/numerictypes.py
index 5a598edcc..e9d408dd4 100644
--- a/numpy/core/numerictypes.py
+++ b/numpy/core/numerictypes.py
@@ -394,16 +394,14 @@ def _set_up_aliases():
('clongfloat', 'clongdouble'),
('longcomplex', 'clongdouble'),
('bool_', 'bool'),
+ ('bytes_', 'string'),
+ ('string_', 'string'),
('unicode_', 'unicode'),
('object_', 'object')]
if sys.version_info[0] >= 3:
- type_pairs.extend([('bytes_', 'string'),
- ('str_', 'unicode'),
- ('string_', 'string')])
+ type_pairs.extend([('str_', 'unicode')])
else:
- type_pairs.extend([('str_', 'string'),
- ('string_', 'string'),
- ('bytes_', 'string')])
+ type_pairs.extend([('str_', 'string')])
for alias, t in type_pairs:
allTypes[alias] = allTypes[t]
sctypeDict[alias] = sctypeDict[t]