Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The yield type of a (async) generator should be the inner type, not the iterator type #75

Closed
llucax opened this issue Jun 9, 2023 · 2 comments

Comments

@llucax
Copy link

llucax commented Jun 9, 2023

Describe the bug
When writing generators, the yield type includes the Iterator type.

To Reproduce
Example file:

from typing import Iterator


def a_generator() -> Iterator[int]:
    """Generate a number.

    Yields:
        A number.
    """
    yield 1

Expected behavior
The yield type should be the inner type, for example for Iterator[int] it should be int.

Screenshots
In this case the yielded type is actually int, not Iterator[int].

image

System (please complete the following information):

  • mkdocstrings-python version: 1.1.2
  • Python version: e.g. 3.11
  • OS: Linux (Debian testing)
@pawamoy
Copy link
Member

pawamoy commented Jun 13, 2023

Hello, thanks for the report. I agree 🙂 We should do the same for Receives. I just pushed a fix and will try to release soon.

@pawamoy pawamoy closed this as completed Jun 13, 2023
@llucax
Copy link
Author

llucax commented Jun 14, 2023

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants