Description:
Verify that generator functions (those using yield) work correctly. Consider if they should have a Yields: section instead of or in addition to Returns:.
Test cases:
def generate_numbers(n: int) -> Generator[int, None, None]:
"""
Should this have Yields or Returns section?
"""
for i in range(n):
yield i
Implementation notes:
- PEP 257 doesn't specifically mention generators
- Google/NumPy style guides use
Yields: section
- Could detect generator functions and use
Yields: instead of Returns:
- Or keep current behavior (Returns) for simplicity
Description:
Verify that generator functions (those using
yield) work correctly. Consider if they should have aYields:section instead of or in addition toReturns:.Test cases:
Implementation notes:
Yields:sectionYields:instead ofReturns: