Skip to content

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.

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