diff options
author | Roman Yurchak <rth.yurchak@pm.me> | 2018-12-01 19:03:55 +0100 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2018-12-01 10:03:55 -0800 |
commit | 0ee245bc6df60b911fafe81a743ec2a68a063c20 (patch) | |
tree | 4b32a0091c206d64ceda3f51ea134661dcaff513 /numpy/distutils/conv_template.py | |
parent | 69addfdfeee4226f723bb1f8d6f583221725319a (diff) | |
download | numpy-0ee245bc6df60b911fafe81a743ec2a68a063c20.tar.gz |
MAINT: Use list and dict comprehension when possible (#12445)
* Use list comprehension
* More list comprehension migration
* Revert key copying in dict
* A few more fixes
* More reverts
* Use dict comprehension
* Fix dict comprehension
* Address review comments
* More review comments
* Fix for empty unpacking of zip(*
* Revert zip(* unpacking altogether
* Fix dict copying
* More simplifications
Diffstat (limited to 'numpy/distutils/conv_template.py')
-rw-r--r-- | numpy/distutils/conv_template.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/numpy/distutils/conv_template.py b/numpy/distutils/conv_template.py index 4a8746236..b33e315b4 100644 --- a/numpy/distutils/conv_template.py +++ b/numpy/distutils/conv_template.py @@ -206,10 +206,8 @@ def parse_loop_header(loophead) : dlist = [] if nsub is None : raise ValueError("No substitution variables found") - for i in range(nsub) : - tmp = {} - for name, vals in names : - tmp[name] = vals[i] + for i in range(nsub): + tmp = {name: vals[i] for name, vals in names} dlist.append(tmp) return dlist |