Highlights
Fixes the long-standing task #68: Python 2.x boolean short-circuit expressions (and / or) now reconstruct as expressions instead of being rendered as cascaded if/elif trees.
Correctness fixes
- Py2.x
JUMP_IF_FALSE_A/JUMP_IF_TRUE_A+POP_TOPchains — peek-and-branch semantics now folded intoASTBinaryAND/OR via a frame-based chain detector, matching Py3's_OR_POPpath. - Py2.4 merged-exit shape — outer
JUMP_IF_FALSEwhose target points past an innerJUMP_IF_*to a sharedPOP_TOPis re-aimed at the inner jump so(b and c) or dno longer collapses tob and (c or d)(semantically different for falsyb). - AST precedence —
LogicalAndbinds tighter thanLogicalOrinASTBinary.codeFragmentso(b or c) and dkeeps its parentheses. - Detector is restricted to the Py2.x peek-and-branch opcodes; the existing 3.x
_OR_POPhandler is untouched (no double-wrap).
Earlier fixes rolled into this release
- Py2.x
STORE_MAPno-op dropped dict entries (2b6400e). - Pure 2.7 listcomp with
UNPACK_SEQUENCE_Ain body (2b6400e). - Py2.x inline listcomp sentinel leak into
COMPARE_OP/CALL(8ce0b8e). - Py2.x nested genexpr/comprehension dropped by phantom
POP_BLOCK(1ac19b8). - Py3.5
BUILD_MAP_UNPACK_WITH_CALLoparg encoding +CALL_FUNCTION_EXalways pops args (65fd52f). - Async comprehension reconstruction across 3.6–3.9 (afe57bd).
CALL_FUNCTION_EXwith non-identifier keys now routed through**{k: v}(8f606bd).- Intrinsic IDs + PEP 696 TypeVar defaults, auto-handler regex, decorator rendering, positional-only defaults in marshal 3.9, silent exception swallow → non-zero exit.
Fixture suite
- 1192 / 1216 passing. Remaining 24 are expected-file gaps, not failures.
- 0 sentinel leaks (
###FIXME###,##ERROR##,##SPECIAL##,##ERROR_DECORATOR##,#TODO) across the whole snapshot tree.
Install
npm install -g depyo@1.0.3