Skip to content

Conversation

jorenham
Copy link
Member

@jorenham jorenham commented Jul 15, 2025

When jorenham/optype@a0b79fc is installed, these changes will resolve the 75 false-positive pyright errors that are reported when running pyright tests or basedpyright tests (without a path these weren't reported).

The changes here should not directly affect the users of static type-checkers other than pyright (assuming they follow the typing spec correctly).

This workaround is a lot more subtle than #742, but requires a releasing a new optype version that removes the first type parameter default for optype.numpy.CanArrayND (which is a breaking change).

Personally, I prefer this workaround over #742. So I'll work on a new optype 0.12 release for this. It's no problem to merge this before that time, since this doesn't cause any new false-positives without the new optype release.

cc @JulVandenBroeck

@jorenham jorenham added this to the 1.16.0.3 milestone Jul 15, 2025
@jorenham jorenham changed the title workaround for path-dependent pyright bug by shuffling disjoint overloads 🎨 workaround for path-dependent pyright bug by shuffling disjoint overloads Jul 15, 2025
@jorenham
Copy link
Member Author

jorenham commented Jul 15, 2025

I've confirmed that together with jorenham/optype#354, this will indeed resolve all 75 false positives that are currently reported when running uv run basedpyright tests.

Note that the next optype release will include other features as well, so I won't be able to release it directly. I guess it'll be tomorrow or the day after.

@jorenham jorenham merged commit 3add079 into master Jul 15, 2025
19 checks passed
@jorenham jorenham deleted the pyright-workarounds-alt branch July 15, 2025 15:52
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.

1 participant