Skip to content

Conversation

@AlexWaygood
Copy link
Member

@overload
def Arg(type: _T, name: str | None = ...) -> _T: ...
@overload
def Arg(name: str | None = ...) -> Any: ...
Copy link
Member

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.

Copy link
Member Author

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 :)

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Collaborator

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.

Copy link
Member Author

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.

Copy link
Member Author

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!

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for double-checking!

Copy link
Member Author

Choose a reason for hiding this comment

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

No problem!

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood requested a review from JelleZijlstra May 24, 2022 18:25
@JelleZijlstra JelleZijlstra merged commit 54e11a1 into master May 24, 2022
@JelleZijlstra JelleZijlstra deleted the AlexWaygood-patch-1 branch May 24, 2022 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants