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/core/numeric.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/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index aa5be1af3..0289add3b 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -2650,10 +2650,7 @@ _errdict = {"ignore": ERR_IGNORE, "print": ERR_PRINT, "log": ERR_LOG} -_errdict_rev = {} -for key in _errdict.keys(): - _errdict_rev[_errdict[key]] = key -del key +_errdict_rev = {value: key for key, value in _errdict.items()} @set_module('numpy') |