◐ Shell
clean mode source ↗

Compiler parity: docstring dedent, StopIteration wrapper, constant folding by youknowone · Pull Request #7530 · RustPython/RustPython

coderabbitai[bot]

coderabbitai[bot]

coderabbitai[bot]

- Docstring dedent (clean_basic_doc): match indentation stripping
- StopIteration wrapper for generators/coroutines (PEP 479)
- Constant condition elimination: if False:/while True: optimization
- do_not_emit_bytecode for dead code paths with sub_table consumption
- POP_JUMP_IF_NONE/NOT_NONE for `x is None` patterns
- CALL_KW threshold: nelts + nkwelts > 15 (STACK_USE_GUIDELINE/2)
- Dict literal chunking: 17-pair chunks matching flowgraph.c
- PEP 709: inlined comprehensions in function scopes, symboltable comp_inlined
- Optimize %-format to f-string bytecode (optimize_format_str)
- expr_constant: safe tuple folding, elif test walk for sub_table consumption
…malization

- Binary op constant folding with Python floor-div/modulo semantics
- Unary negative folding into LOAD_CONST, with binop re-run
- Tuple/list/set/frozenset constant folding
- STORE_FAST_LOAD_FAST combination (insert_superinstructions before optimize_load_fast)
- JUMP → RETURN_VALUE inlining (normalize_jumps)
- RESUME depth correction for StopIteration wrapper
- DCE, unreachable block elimination, duplicate_end_returns
- bytecode.rs: ConvertValue, FormatSimple, LoadFastAndClear, MakeCell instructions
- frame.rs: StopIteration handling, RESUME depth support
- _symtable.rs: filter inlined comprehension children
- jit/instructions.rs: StoreFastLoadFast support
- monitoring.rs: LINE event for non-function scopes
- Remove expectedFailure markers for passing tests

coderabbitai[bot]

coderabbitai[bot]

- expr_constant: don't fold non-empty tuples (may have side effects)
- %-format optimization: skip when tuple contains starred elements
- _symtable children: flatten inlined comp children instead of dropping

This was referenced

Mar 30, 2026