Skip to content

Conversation

pechersky
Copy link
Contributor

Should the language of DOC5* be modified to include assert? Should it be a new DOC rule?

Closes #213.

Should the language of DOC5* be modified to include assert?
Should it be a new DOC rule?

Closes jsh9#213.
node: FuncOrAsyncFuncDef,
) -> Generator[str, None, None]:
"""Yield the raised exceptions in a function node"""
) -> Iterator[str, None, None]:
Copy link
Owner

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

def _extractExceptionsFromExcept(
node: ast.ExceptHandler,
) -> Generator[str, None, None]:
) -> Iterator[str]:
Copy link
Owner

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].

@jsh9 jsh9 merged commit 4a16088 into jsh9:main Feb 16, 2025
16 checks passed
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

Successfully merging this pull request may close these issues.

DOC502 Raises section in response to assert

2 participants