Skip to content

fix float <: CanRound2[int, float]#597

Merged
jorenham merged 1 commit into
masterfrom
gh-596
May 17, 2026
Merged

fix float <: CanRound2[int, float]#597
jorenham merged 1 commit into
masterfrom
gh-596

Conversation

@jorenham

Copy link
Copy Markdown
Owner

fixes #596

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.

Pull request overview

This PR addresses #596 by aligning the rounding protocols with positional-only __round__ signatures so float can satisfy CanRound2/CanRound.

Changes:

  • Updates CanRound2 and CanRound overload signatures for ndigits.
  • Adds a regression test for float assignability to rounding protocols.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
optype/_core/_can.py Adjusts rounding protocol method parameter kind.
tests/core/test_can.py Adds regression coverage for float rounding protocol assignability.

Comment thread tests/core/test_can.py
@github-actions

Copy link
Copy Markdown
Contributor

mypy_primer results

✅ No ecosystem changes detected

@jorenham jorenham merged commit 6765f61 into master May 17, 2026
37 checks passed
@jorenham jorenham deleted the gh-596 branch May 17, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

float is not assignable to CanRound2[int, float]?

2 participants