This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients Dennis Sweeney, bbayles, rhettinger, serhiy.storchaka, tim.peters
Date 2020-03-14.22:02:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1584223366.01.0.962945103334.issue38938@roundup.psfhosted.org>
In-reply-to
Content
Sorry, I did not notice that there is a C implementation in PR 18427. Changes in the Python implementations are so larger that I though this is the goal of the PR.

Often the most clear and efficient way to implement an iterator in Python is to write a generator function. In C you need to write a class with the __next__ method, but Python has better way.

I have tested your first example with the Python implementation and got 93.9 msec on master vs 314 msec with PR 18427 applied. It is expected that the C implementation is faster than the Python implementation, but was there a need to make the Python implementation 3 times slower?
History
Date User Action Args
2020-03-14 22:02:46serhiy.storchakasetrecipients: + serhiy.storchaka, tim.peters, rhettinger, bbayles, Dennis Sweeney
2020-03-14 22:02:46serhiy.storchakasetmessageid: <1584223366.01.0.962945103334.issue38938@roundup.psfhosted.org>
2020-03-14 22:02:45serhiy.storchakalinkissue38938 messages
2020-03-14 22:02:45serhiy.storchakacreate