Skip to content

"No overload variant of "next" matches argument types" for types.Iterable #3490

@rollcat

Description

@rollcat

Here's a short example of what I'd think should be a correctly typed program...

from typing import Iterable


def f() -> Iterable[int]:
    yield 1


print(next(f()))

Running mypy on this (under Python 3.4, no strict mode, no other flags at all) results in the following error:

error: No overload variant of "next" matches argument types [typing.Iterable[builtins.int]]

Is this a bug, or am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions