Skip to content

Preserve fallback value types in BaseDict get and pop - #632

Merged
fabiocaccamo merged 1 commit into
fabiocaccamo:mainfrom
xiehuanyi:fix/base-dict-default-types-20261013
Oct 20, 2026
Merged

fabiocaccamo merged 1 commit into
fabiocaccamo:mainfrom
xiehuanyi:fix/base-dict-default-types-20261013

Conversation

@xiehuanyi

Copy link
Copy Markdown
Contributor

For BaseDict[str, int], get("missing", "fallback") works at runtime but is rejected by the type checker. pop("missing", None) is incorrectly typed as int even though it returns None.

Add overloads that match native dictionary fallback typing. Cover the result types and runtime values for both a wrapped dictionary and native storage. All 964 unittest cases pass. Package and focused type checks, Ruff lint, and formatting pass.

Copilot AI balanced review requested due to automatic review settings October 13, 2026 18:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Oct 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.69%. Comparing base (c4c8a58) to head (a78fd9a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #632   +/-   ##
=======================================
  Coverage   98.69%   98.69%           
=======================================
  Files          65       65           
  Lines        2446     2447    +1     
=======================================
+ Hits         2414     2415    +1     
  Misses         32       32           
Flag Coverage Δ
unittests 98.69% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@fabiocaccamo
fabiocaccamo merged commit 92f38a0 into fabiocaccamo:main Oct 20, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants