Skip to content

Infer SendType in a Python Generator (Coroutine) #9576

Answered by erictraut
Tomperez98 asked this question in Q&A
Discussion options

You must be logged in to vote

Pyright uses the specified SendType from the return type. If you are using multiple different send types in your generator (which is pretty atyipcal), you'd need to declare the type on the receiving variable like you've done in your example.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Tomperez98
Comment options

@erictraut
Comment options

Answer selected by Tomperez98
@Tomperez98
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants