gh-131798: Constant-fold _CONTAINS_OP_DICT for frozendict (GH-148548)

This commit is contained in:
Wulian233 2026-04-14 23:04:28 +08:00 committed by GitHub
parent 52a7f1b7f8
commit e0b56f006c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 84 additions and 1 deletions

View file

@ -771,6 +771,10 @@ dummy_func(void) {
b = sym_new_type(ctx, &PyBool_Type);
l = left;
r = right;
if (sym_is_not_container(left) &&
sym_matches_type(right, &PyFrozenDict_Type)) {
REPLACE_OPCODE_IF_EVALUATES_PURE(left, right, b);
}
}
op(_LOAD_CONST, (-- value)) {