-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
mypy_extensions
: fix TypeVar
usage
#7937
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
Conversation
@overload | ||
def Arg(type: _T, name: str | None = ...) -> _T: ... | ||
@overload | ||
def Arg(name: str | None = ...) -> Any: ... |
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.
Shouldn't this be keyword-only?
Also we should make sure that mypy still works with this change, it may special-case the definitions here.
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.
Also we should make sure that mypy still works with this change, it may special-case the definitions here.
I was hoping primer would answer that question for me :)
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.
Not sure anyone in primer uses these things though.
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.
I'm going to try running the mypy test suite using MYPYPATH
to point at the stubs with this revision.
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.
I think mypy won't like trying to use MYPYPATH for mypy_extensions (or maybe might ignore it). You're probably better off replacing mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi
. But also I'm happy to yolo this.
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.
Tests all passed on my machine using MYPYPATH
, I'm now trying @hauntsaninja's way as well.
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.
Tests also all pass on my machine with the manual edit of mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi
.
I'm also happy for this to be reverted if mypy's CI starts breaking unexpectedly!
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.
Thanks for double-checking!
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.
No problem!
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
#7928