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

Updated conformance tests for pyright 1.1.394. #1926

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

erictraut
Copy link
Collaborator

This version of pyright fixes a conformance issue detected by the callables_kwargs test. Also updated the annotations_generatosr and annotations_coroutines test cases to accommodate a more precise (narrower) type inferred for async def functions. Pyright now infers types.CoroutineType rather than typing.Coroutine. Both are correct and should be accepted by the test.

This version of pyright fixes a conformance issue detected by the `callables_kwargs` test.
Also updated the `annotations_generatosr` and `annotations_coroutines` test cases to accommodate a more precise (narrower) type inferred for `async def` functions. Pyright now infers `types.CoroutineType` rather than `typing.Coroutine`. Both are correct and should be accepted by the test.
@@ -16,7 +16,10 @@ async def func1(ignored: int, /) -> str:
return "spam"


assert_type(func1, Callable[[int], Coroutine[Any, Any, str]])
# Don't use assert_type here because some type checkers infer
# the narrower type types.CoroutineType rather than typing.Coroutine
Copy link
Member

Choose a reason for hiding this comment

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

This can wait but I'd favor making the conformance tests test for CoroutineType here in the future. It's the precise type at runtime, and ideally it's what type checkers should infer.

@erictraut erictraut merged commit 05b979d into python:main Feb 17, 2025
4 checks passed
@erictraut erictraut deleted the pyright394 branch February 17, 2025 19:45
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.

2 participants