Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

It is not easy to avoid reference cycles if use a generator function. And 
generator function is much faster than an implementation as a class with the 
__next__ method. We need to access the iterator object from the code of the 
generator function, and this creates a cycle.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35502>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to