Fix issue with custom hook `Doc.sents` definition
@@ -431,7 +431,9 @@ cdef class Doc:
"""
def __get__(self):
if 'sents' in self.user_hooks:
- return self.user_hooks['sents'](self)
+ for sent in self.user_hooks['sents'](self):
+ yield sent
+ return
if not self.is_parsed:
raise ValueError(
