Try to pre-compute a frozenset literal during module initialization. Return None if it's not possible. Supported items: - Anything supported by irbuild.constant_fold.constant_fold_expr() - None, True, and False - Tuple literals with only items listed above
(builder: IRBuilder, s: SetExpr)
| 892 | |
| 893 | |
| 894 | def precompute_set_literal(builder: IRBuilder, s: SetExpr) -> Value | None: |
| 895 | """Try to pre-compute a frozenset literal during module initialization. |
| 896 | |
| 897 | Return None if it's not possible. |
| 898 | |
| 899 | Supported items: |
| 900 | - Anything supported by irbuild.constant_fold.constant_fold_expr() |
| 901 | - None, True, and False |
| 902 | - Tuple literals with only items listed above |
| 903 | """ |
| 904 | values = set_literal_values(builder, s.items) |
| 905 | if values is not None: |
| 906 | return builder.add(LoadLiteral(frozenset(values), set_rprimitive)) |
| 907 | |
| 908 | return None |
| 909 | |
| 910 | |
| 911 | def transform_comparison_expr(builder: IRBuilder, e: ComparisonExpr) -> Value: |
no test coverage detected
searching dependent graphs…