Skip to content

fix(_types): ParsedName repr names the token behind each ambiguity - #447

Merged
derek73 merged 1 commit into
masterfrom
claude/issue-431-ambiguity-repr-c4e54e
Aug 27, 2026
Merged

fix(_types): ParsedName repr names the token behind each ambiguity#447
derek73 merged 1 commit into
masterfrom
claude/issue-431-ambiguity-repr-c4e54e

Conversation

@derek73

@derek73 derek73 commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • ParsedName.__repr__ rendered the ambiguities line as [a.kind.value for a in self.ambiguities], so two distinct Ambiguity objects of the same kind about different words collapsed into identical-looking entries (['suffix-or-name', 'suffix-or-name']), reading as a double-emit bug in the emitter rather than the two separate, correctly-distinct calls they are.
  • Follows Ambiguity.__repr__'s own token-join convention ("/".join(t.text for t in self.tokens)) so each entry names its token(s): ['suffix-or-name: MA', 'suffix-or-name: V']. Falls back to bare kind.value when an ambiguity has no tokens (e.g. UNBALANCED_DELIMITER).

Fixes #431

Test plan

  • Updated tests/v2/test_reprs.py::test_parsedname_repr_includes_ambiguities_line_when_present for the new format
  • Added tests/v2/test_reprs.py::test_parsedname_repr_distinguishes_same_kind_ambiguities_by_token, a regression test for the exact two-ambiguity case from the issue
  • Full suite passes: uv run pytest -q → 5924 passed, 154 skipped, 9 xfailed

🤖 Generated with Claude Code

Two distinct suffix-or-name ambiguities about different words
rendered as identical ['suffix-or-name', 'suffix-or-name'] entries,
reading as a double-emit bug rather than two separate calls. Follow
Ambiguity.__repr__'s own token-join convention so each entry names
its token(s), e.g. ['suffix-or-name: MA', 'suffix-or-name: V'].

Fixes #431

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@derek73 derek73 added the bug label Aug 27, 2026
@derek73 derek73 self-assigned this Aug 27, 2026
@derek73 derek73 added this to the v2.2 milestone Aug 27, 2026
@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.61%. Comparing base (2c92925) to head (048935b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #447   +/-   ##
=======================================
  Coverage   98.61%   98.61%           
=======================================
  Files          45       45           
  Lines        3095     3095           
=======================================
  Hits         3052     3052           
  Misses         43       43           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@derek73
derek73 merged commit 388f9f6 into master Aug 27, 2026
11 checks passed
@derek73
derek73 deleted the claude/issue-431-ambiguity-repr-c4e54e branch August 27, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

repr(ParsedName) prints ['suffix-or-name', 'suffix-or-name'] for two different words

1 participant