|
52 | 52 | is_sequence_rprimitive,
|
53 | 53 | is_short_int_rprimitive,
|
54 | 54 | is_str_rprimitive,
|
55 |
| - is_true_dict_rprimitive, |
| 55 | + is_exact_dict_rprimitive, |
56 | 56 | is_tuple_rprimitive,
|
57 | 57 | object_pointer_rprimitive,
|
58 | 58 | object_rprimitive,
|
@@ -422,7 +422,7 @@ def make_for_loop_generator(
|
422 | 422 | expr_reg = builder.accept(expr)
|
423 | 423 | target_type = builder.get_dict_key_type(expr)
|
424 | 424 | for_loop_cls = (
|
425 |
| - ForTrueDictionaryKeys if is_true_dict_rprimitive(rtyp) else ForDictionaryKeys |
| 425 | + ForExactDictionaryKeys if is_exact_dict_rprimitive(rtyp) else ForDictionaryKeys |
426 | 426 | )
|
427 | 427 | for_dict = for_loop_cls(builder, index, body_block, loop_exit, line, nested)
|
428 | 428 | for_dict.init(expr_reg, target_type)
|
@@ -506,20 +506,20 @@ def make_for_loop_generator(
|
506 | 506 | for_dict_type: type[ForGenerator] | None = None
|
507 | 507 | if expr.callee.name == "keys":
|
508 | 508 | target_type = builder.get_dict_key_type(expr.callee.expr)
|
509 |
| - if is_true_dict_rprimitive(rtype): |
510 |
| - for_dict_type = ForTrueDictionaryKeys |
| 509 | + if is_exact_dict_rprimitive(rtype): |
| 510 | + for_dict_type = ForExactDictionaryKeys |
511 | 511 | else:
|
512 | 512 | for_dict_type = ForDictionaryKeys
|
513 | 513 | elif expr.callee.name == "values":
|
514 | 514 | target_type = builder.get_dict_value_type(expr.callee.expr)
|
515 |
| - if is_true_dict_rprimitive(rtype): |
516 |
| - for_dict_type = ForTrueDictionaryValues |
| 515 | + if is_exact_dict_rprimitive(rtype): |
| 516 | + for_dict_type = ForExactDictionaryValues |
517 | 517 | else:
|
518 | 518 | for_dict_type = ForDictionaryValues
|
519 | 519 | else:
|
520 | 520 | target_type = builder.get_dict_item_type(expr.callee.expr)
|
521 |
| - if is_true_dict_rprimitive(rtype): |
522 |
| - for_dict_type = ForTrueDictionaryItems |
| 521 | + if is_exact_dict_rprimitive(rtype): |
| 522 | + for_dict_type = ForExactDictionaryItems |
523 | 523 | else:
|
524 | 524 | for_dict_type = ForDictionaryItems
|
525 | 525 | for_dict_gen = for_dict_type(builder, index, body_block, loop_exit, line, nested)
|
@@ -1009,23 +1009,23 @@ def begin_body(self) -> None:
|
1009 | 1009 | builder.assign(target, rvalue, line)
|
1010 | 1010 |
|
1011 | 1011 |
|
1012 |
| -class ForTrueDictionaryKeys(ForDictionaryKeys): |
| 1012 | +class ForExactDictionaryKeys(ForDictionaryKeys): |
1013 | 1013 | """Generate optimized IR for a for loop over dictionary items without type checks."""
|
1014 | 1014 |
|
1015 | 1015 | dict_next_op = true_dict_next_key_op
|
1016 | 1016 | dict_iter_op = true_dict_iter_fast_path_op
|
1017 | 1017 | dict_size_op = true_dict_check_size_op
|
1018 | 1018 |
|
1019 | 1019 |
|
1020 |
| -class ForTrueDictionaryValues(ForDictionaryValues): |
| 1020 | +class ForExactDictionaryValues(ForDictionaryValues): |
1021 | 1021 | """Generate optimized IR for a for loop over dictionary items without type checks."""
|
1022 | 1022 |
|
1023 | 1023 | dict_next_op = true_dict_next_value_op
|
1024 | 1024 | dict_iter_op = true_dict_iter_fast_path_op
|
1025 | 1025 | dict_size_op = true_dict_check_size_op
|
1026 | 1026 |
|
1027 | 1027 |
|
1028 |
| -class ForTrueDictionaryItems(ForDictionaryItems): |
| 1028 | +class ForExactDictionaryItems(ForDictionaryItems): |
1029 | 1029 | """Generate optimized IR for a for loop over dictionary items without type checks."""
|
1030 | 1030 |
|
1031 | 1031 | dict_next_op = true_dict_next_item_op
|
|
0 commit comments