[py3] user iter to iterate on dict values
authorKatia Saurfelt <katia.saurfelt@logilab.fr>
Tue, 21 Aug 2018 15:50:28 +0200
changeset 538 98d6979ec07d
parent 536 e4a5bd981a41
child 539 7cd2b9a4d60c
[py3] user iter to iterate on dict values
nazca/rl/blocking.py
--- a/nazca/rl/blocking.py	Thu Aug 16 16:46:47 2018 +0200
+++ b/nazca/rl/blocking.py	Tue Aug 21 15:50:28 2018 +0200
@@ -28,9 +28,8 @@
 
 """
 from functools import partial
-import warnings
 
-from six import iteritems
+from six import iteritems, itervalues
 
 from scipy.spatial import KDTree
 
@@ -418,7 +417,7 @@
                   and merged_dataset_dict[record[attr_index]][2] < score):
                 # Change current score
                 merged_dataset_dict[record[attr_index]] = (ind, record, score)
-        return [(ind, r[0]) for ind, r, score in merged_dataset_dict.itervalues()]
+        return [(ind, r[0]) for ind, r, score in itervalues(merged_dataset_dict)]
 
     def _iter_blocks(self):
         """ Iterator over the different possible blocks.