-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Improve documentation for annotating generator functions #11623
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
Conversation
The mypy documentation is currently ambivalent on whether ``Iterator`` or ``Iterable`` is the better return-type annotation for a simple generator function. The documentation should endorse using ``Iterator`` instead of ``Iterable`, in my opinion, as it is a more precise return type, and no less concise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, one question from me 🙂
Related python/cpython#29170
|
@sobolevn, thoughts on the PR now? 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
Thank you!
|
Thank you! |
Thanks for the reviews! |
The mypy documentation is currently ambivalent on whether ``Iterator`` or ``Iterable`` is the better return-type annotation for a simple generator function. The documentation should endorse using ``Iterator`` instead of ``Iterable`, in my opinion, as it is a more precise return type, and no less concise.
The mypy documentation is currently ambivalent on whether
IteratororIterableis the better return-type annotation for a simple generator function. The documentation should endorse usingIteratorinstead ofIterable, in my opinion, as it is a more precise return type, and no less concise.