-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve pyright compatibility by using TypeVar
's default
argument
#1246
base: main
Are you sure you want to change the base?
Improve pyright compatibility by using TypeVar
's default
argument
#1246
Conversation
Pull Request Test Coverage Report for Build 11990416916Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question inline about using the generic type var instead Any
. But if that doesn't work I'm fine with this.
Now that we are doing a major release, I might use the suggestion from #1242 (comment) to fix it in a more proper way using |
Any
for PyGraph
and PyDiGraph
type annotations for pyright compatibilityTypeVar
's default argument
TypeVar
's default argumentTypeVar
's default
argument
5d736ac
to
bd6600d
Compare
I tested with
Instead of the original error. If I use the wheel from PyPI it fails with the same error message from the Issue so I am confident the fix work. It also has a much smaller diff than the original solution so that is a win |
Closes #1242
This is a pretty annoying PR but it avoids
pyright
from infering the types asUnknown
. Although we will only keepmypy
in the CI,pyright
is the base forpylance
which ships with VSCode. And we got VSCode issues in the past (#832), so I think it's worth supporting.