-
Notifications
You must be signed in to change notification settings - Fork 15
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
Review DOC404
/ DOC405
(Generator vs Iterator)
#76
Comments
DOC404
/ DOC405
(Generator vs Iterator)
Hi @llucax , you convinced me. I implemented #77 to stop enforcing people to use Generators. And to address the corner case where a function both yields and returns stuff, I implemented #78, as well as 3 other PRs from another library:
Please try out version 0.3.0 (or above). If you find any issues, please don't hesitate to leave other comments! |
Thanks @jsh9, I really appreciate it! We are finally switching all our projects to pydoclint ❤️ |
Glad to hear that! Thank you for making all these suggestions and providing me test cases! |
The rule imposed by
DOC404
/DOC405
, including the justification in Notes on Generator vs Iterator doesn't go in line with Python's official documentation, which explicitly saysIterator
andAsyncIterator
can be used as return types for functions thatyield
(even more, the documentation say that alsoIterable
/AsyncIterable
can be used).Having this (artificial) restriction in
pydoclint
only makes users have to write more pedantic code, which is also harder to read for the casual reader (what are all theNone
inGenerator
?), when the shorter form is supported by Python and type-checkers likemypy
andpyright
.The text was updated successfully, but these errors were encountered: