🎨 workaround for path-dependent pyright bug by shuffling disjoint overloads #745
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When
jorenham/optype@a0b79fc
is installed, these changes will resolve the 75 false-positive pyright errors that are reported when runningpyright tests
orbasedpyright 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 foroptype.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