Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created March 9, 2026 17:48
Show Gist options
  • Select an option

  • Save mypy-play/4293848a184dac5a7b49d3a7b5ed71c8 to your computer and use it in GitHub Desktop.

Select an option

Save mypy-play/4293848a184dac5a7b49d3a7b5ed71c8 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
from typing import reveal_type
from typing import Generator, AsyncGenerator
def async_returns_generator() -> Generator[int, int, None] | AsyncGenerator[int, int]:
x = yield 1
reveal_type(x)
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment