Skip to content

Enforce send type with yield from #5716

@erictraut

Description

@erictraut

Currently pyright doesn't enforce the "send" type for generators when a yield from statement is used.

from typing import Generator


def func1() -> Generator[None, int, None]:
    x: int = yield


def func2() -> Generator[None, str, None]:
    yield from func1()

This is related to mypy issue python/mypy#14834.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions