mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-10 02:12:09 +00:00

Some checks are pending
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
59 lines
898 B
Python
59 lines
898 B
Python
from collections.abc import Generator, AsyncGenerator
|
|
|
|
|
|
def func() -> Generator[int, None, None]:
|
|
yield 42
|
|
|
|
|
|
def func() -> Generator[int, None]:
|
|
yield 42
|
|
|
|
|
|
def func() -> Generator[int]:
|
|
yield 42
|
|
|
|
|
|
def func() -> Generator[int, int, int]:
|
|
foo = yield 42
|
|
return foo
|
|
|
|
|
|
def func() -> Generator[int, int, None]:
|
|
_ = yield 42
|
|
return None
|
|
|
|
|
|
def func() -> Generator[int, None, int]:
|
|
yield 42
|
|
return 42
|
|
|
|
|
|
async def func() -> AsyncGenerator[int, None]:
|
|
yield 42
|
|
|
|
|
|
async def func() -> AsyncGenerator[int]:
|
|
yield 42
|
|
|
|
|
|
async def func() -> AsyncGenerator[int, int]:
|
|
foo = yield 42
|
|
return foo
|
|
|
|
|
|
from typing import Generator, AsyncGenerator
|
|
|
|
|
|
def func() -> Generator[str, None, None]:
|
|
yield "hello"
|
|
|
|
|
|
async def func() -> AsyncGenerator[str, None]:
|
|
yield "hello"
|
|
|
|
|
|
async def func() -> AsyncGenerator[ # type: ignore
|
|
str,
|
|
None
|
|
]:
|
|
yield "hello"
|