Repository navigation
v0.6.0
·
18 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
What's Changed
Assignment-based dataflow type inference
pytest-leela now infers types through local variable assignments, even in code with no type annotations. This enables mutation pruning on previously untypeable code.
- Forward propagation:
x = "hello"→x + yis recognized as string concatenation and pruned (0 mutations instead of 2) - Parameter tracking:
y = xwherex: intcorrectly infersyasint - Conflict detection:
x = 1; x = "a"→ type collapses to unknown (safe) - Enrichment stats reporting: Terminal output now shows the breakdown:
Type enrichment: 108 from annotations, 25 from assignment dataflow
Results on untyped code
- 25 additional type enrichments from dataflow on a zero-annotation module
- 7 additional mutations pruned
- ~0 extra time cost (pure AST walk, no external dependencies)
Also includes
- Extracted
_type_of_value_nodeshared helper to deduplicate type inference EnrichmentStatsdataclass with__add__for multi-file aggregation- 100% mutation kill rate (234/234 on target code, 590/590 overall)
- Realistic untyped test target module (
assignment_targets.py)
Full Changelog: v0.5.0...v0.6.0