-
Notifications
You must be signed in to change notification settings - Fork 17
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
Include AssertionError in Raises section #215
Conversation
Should the language of DOC5* be modified to include assert? Should it be a new DOC rule? Closes jsh9#213.
@@ -114,8 +114,8 @@ def getRaisedExceptions(node: FuncOrAsyncFuncDef) -> list[str]: | |||
|
|||
def _getRaisedExceptions( | |||
node: FuncOrAsyncFuncDef, | |||
) -> Generator[str, None, None]: | |||
"""Yield the raised exceptions in a function node""" | |||
) -> Iterator[str, None, None]: |
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.
Hi @pechersky , using Generator[str, None, None]
is preferred here. You can read more here: https://jsh9.github.io/pydoclint/notes_generator_vs_iterator.html
@@ -189,7 +192,7 @@ def _getRaisedExceptions( | |||
|
|||
def _extractExceptionsFromExcept( | |||
node: ast.ExceptHandler, | |||
) -> Generator[str, None, None]: | |||
) -> Iterator[str]: |
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.
Iterator[str]
is sort of a shorthand for Generator[str, None, None]
. (And in Python 3.14, Generator[str]
is finally recognized as a shorthand for Generator[str, None, None]
.)
But to be consistent with existing functions in this file, I'll revert back to using Generator[str, None, None]
.
Should the language of DOC5* be modified to include assert? Should it be a new DOC rule?
Closes #213.