Updated conformance tests for pyright 1.1.394.#1926
Merged
erictraut merged 1 commit intopython:mainfrom Feb 17, 2025
Merged
Conversation
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.
|
|
||
| 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 |
Member
There was a problem hiding this comment.
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.
JelleZijlstra
approved these changes
Feb 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This version of pyright fixes a conformance issue detected by the
callables_kwargstest. Also updated theannotations_generatosrandannotations_coroutinestest cases to accommodate a more precise (narrower) type inferred forasync deffunctions. Pyright now inferstypes.CoroutineTyperather thantyping.Coroutine. Both are correct and should be accepted by the test.