summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorJoseph R. Fox-Rabinovitz <jfoxrabinovitz@gmail.com>2019-11-22 21:48:57 -0500
committerJoseph R. Fox-Rabinovitz <jfoxrabinovitz@gmail.com>2019-12-02 23:41:43 -0500
commitf0c6e41202e725debfe4c2a4694e791681210dbd (patch)
tree3385c0992201b21f35cd3b0650746ee35d30961c /numpy/lib
parent3a9a63f81aa37b48bc3eb4efdc2e695210805aa5 (diff)
downloadnumpy-f0c6e41202e725debfe4c2a4694e791681210dbd.tar.gz
MAINT: Cleaned up mintypecode for Py3
Using generators instead of full-blown lists Using set for search instead of list Using min to get single element insteaf of sorting full list
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/type_check.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/type_check.py b/numpy/lib/type_check.py
index 8b9e4b8ab..977117235 100644
--- a/numpy/lib/type_check.py
+++ b/numpy/lib/type_check.py
@@ -75,7 +75,7 @@ def mintypecode(typechars, typeset='GDFgdf', default='d'):
return default
if 'F' in intersection and 'd' in intersection:
return 'D'
- return min((_typecodes_by_elsize.index(t), t) for t in intersection)[1]
+ return min(intersection, key=_typecodes_by_elsize.index)
def _asfarray_dispatcher(a, dtype=None):