8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f33a53e commit 9b7ada8Copy full SHA for 9b7ada8
numpydoc/validate.py
@@ -178,6 +178,10 @@ def type(self):
178
def is_function_or_method(self):
179
return inspect.isfunction(self.obj)
180
181
+ @property
182
+ def is_generator_function(self):
183
+ return inspect.isgeneratorfunction(self.obj)
184
+
185
@property
186
def source_file_name(self):
187
"""
@@ -596,7 +600,7 @@ def validate(obj_name):
596
600
for name_or_type, type_, desc in doc.returns:
597
601
errs.extend(_check_desc(desc, "RT03", "RT04", "RT05"))
598
602
599
- if not doc.yields and "yield" in doc.method_source:
603
+ if not doc.yields and doc.is_generator_function:
604
errs.append(error("YD01"))
605
606
if not doc.see_also:
0 commit comments