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 scoder
Recipients asvetlov, gvanrossum, scoder, vstinner, yselivanov
Date 2015-05-01.12:19:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> I don't think it's necessary to have slots for __aiter__, __anext__, __aenter__ and __aexit__.  Async iteration will never be as fast as regular iteration, and there is plenty overhead in it.

You seem to be assuming that the outer loop is the asyncio I/O loop. That might not be the case. It might be a thread-pool executor, it might be an in-memory task switcher, or it might just be something passing on items from a list. At least "__anext__" is worth being fast, IMHO.

Also note that one advantage of slots is that the user can cache their value to keep calling the same C function multiple times. That is not the case for a Python method, which can easily be replaced. Some iterators do that with their __next__ method, and it's perfectly valid. Having to look up the Python method on each iteration and calling through it sounds like unnecessary overhead.
Date User Action Args
2015-05-01 12:19:22scodersetrecipients: + scoder, gvanrossum, vstinner, asvetlov, yselivanov
2015-05-01 12:19:22scodersetmessageid: <>
2015-05-01 12:19:22scoderlinkissue24017 messages
2015-05-01 12:19:22scodercreate