python: Better iterate over dictionaries

In Python 2, dictionaries have 2 sets of methods to iterate over their
keys and values: keys()/values()/items() and iterkeys()/itervalues()/iteritems().

The former return lists while the latter return iterators.

Python 3 dropped the method which return lists, and renamed the methods
returning iterators to keys()/values()/items().

Using those names makes the scripts compatible with both Python 2 and 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
This commit is contained in:
Mathieu Bridon
2018-07-06 12:20:26 +02:00
committed by Dylan Baker
parent fdf946ffbf
commit 5530cb1296
12 changed files with 26 additions and 26 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ nir_type_conversion_op(nir_alu_type src, nir_alu_type dst, nir_rounding_mode rnd
}
const nir_op_info nir_op_infos[nir_num_opcodes] = {
% for name, opcode in sorted(opcodes.iteritems()):
% for name, opcode in sorted(opcodes.items()):
{
.name = "${name}",
.num_inputs = ${opcode.num_inputs},