Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
Thank you Raymond for the explanation. I didn't realise that there was a technical reason why built-in generators had to be implemented as classes in CPython. Sanmitha's question was already discussed answered here: https://discuss.python.org/t/enumerate-function-or-class/10504/1 ---------- nosy: +steven.daprano _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45154> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com