AlignDiff Open AlignDiff

Python comparison example

Compare Python code by function, not only by line number

Python refactors often move helper functions while changing names, parameters, calculations, and return expressions. AlignDiff keeps likely counterparts together before showing the detailed edits.

AlignDiff marketing preview showing structure-aware code comparison
AlignDiff public beta · Python, JavaScript, and TypeScript · source stays in the browser

Strongest current example

A checkout refactor with four different review signals

Moved + modified

calculate_order_total changes position, parameters, local names, and calculations.

Renamed

calculate_total is paired with compute_total.

Inserted statement

A tax calculation stays one-sided instead of shifting the following rows.

Inserted helper

calculate_tax appears as new code rather than a false counterpart.

Actual AlignDiff Python comparison for checkout_before.py and checkout_after.py
Actual output from aligndiff.com for the public checkout refactor fixture.

How to read the result

Start with block status, then inspect changed rows

  1. 1

    Confirm the pair

    Check that the old and new function are credible counterparts. Review possible alternatives when confidence is not strong.

  2. 2

    Separate movement from modification

    The block label explains that source position changed; highlighted rows explain what changed inside it.

  3. 3

    Inspect one-sided rows

    Inserted tax logic remains visibly new, while related return statements remain aligned.

Current Python boundary

Designed for review, not execution

AlignDiff treats Python as source text and never executes it. The parser can identify supported structures and the comparison engine can align their detailed changes.

Syntax errors or unsupported constructs may reduce structural coverage or trigger text fallback. Important changes still require tests and human review.