Skip to content

Conversation

@SwayamInSync
Copy link
Member

closes #198

Copy link
Contributor

@juntyr juntyr left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

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

Awesome, just a few minor comments.

@SwayamInSync
Copy link
Member Author

@ngoldbaum suggestions applied

@ngoldbaum ngoldbaum merged commit 6cfc296 into numpy:main Oct 23, 2025
10 checks passed
@ngoldbaum
Copy link
Member

I realized after we merged this that this doesn't update the type stubs. Ping @jorenham. Not sure if there's any testing we can do to ensure the tests themselves don't do things that violate the type stubs?

@jorenham
Copy link
Member

jorenham commented Oct 24, 2025

Not sure if there's any testing we can do to ensure the tests themselves don't do things that violate the type stubs?

Stubtest is able to detect any api changes that are visible by using the inpsect stdlib. But this PR broadens the types that QuadPrecision.__new__ can accept, so that's not something stubtest can pick up on.
I suppose that you could've detected this if there would've been a hand-written type-test that ensures that type-checkers reject things like QuadPrecision(np.int8()). NumPy has a bunch of tests like these, but those are by no means exhaustive.
And unfortunately there exists hypothesis-like fuzz-testing tool for static typing in Python, as far as I'm aware.

TLDR; theoretically yes, practically no 🤷🏻

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.

Enable QuadPrecision() operating on np.ndarray or np.number

4 participants