mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-28 10:50:26 +00:00
19 lines
242 B
Python
19 lines
242 B
Python
def f() -> int:
|
|
yield 1
|
|
|
|
|
|
class Foo:
|
|
yield 2
|
|
|
|
|
|
yield 3
|
|
yield from 3
|
|
await f()
|
|
|
|
def _():
|
|
# Invalid yield scopes; but not outside a function
|
|
type X[T: (yield 1)] = int
|
|
type Y = (yield 2)
|
|
|
|
# Valid yield scope
|
|
yield 3
|