Skip to content
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

Conformance tests: Ignore overlapping overload errors in LiteralString #1701

Merged
merged 3 commits into from
Apr 10, 2024

Conversation

JelleZijlstra
Copy link
Member

Part of #1692

@JelleZijlstra
Copy link
Member Author

@erictraut do you have an opinion on this one? It's probably possible to rewrite the test to avoid the overlapping overload errors instead.

@erictraut
Copy link
Collaborator

I don't have a strong opinion. I'm fine with changing the test to eliminate the condition that leads to this error. I'm also fine suppressing the error. If you prefer, we could suppress the error by adding a # pyright: reportOverlappingOverload=false at the top of the file or a # pyright: ignore[reportOverlappingOverload] on that line. (Technically, mypy should be generating an "overlapping overload" error here as well. The fact that it doesn't is presumably because it doesn't yet have full support for LiteralString.) Whatever you prefer is fine with me.

@JelleZijlstra
Copy link
Member Author

Thanks! I thought of a simple way to write the test that avoids overlapping overloads, so I'll push that in a minute.

Technically, mypy should be generating an "overlapping overload" error here as well. The fact that it doesn't is presumably because it doesn't yet have full support for LiteralString.

It does detect it; in the current version of the PR I made it ignore the mypy error as well. Mypy currently treats LiteralString as a synonym of str.

@JelleZijlstra JelleZijlstra merged commit 8ff42d7 into python:main Apr 10, 2024
4 checks passed
@JelleZijlstra JelleZijlstra deleted the literalstr branch April 10, 2024 14:01
JelleZijlstra added a commit to JelleZijlstra/typing that referenced this pull request Apr 11, 2024
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.

None yet

2 participants