➜

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.

作者 scoder
收信人 asvetlov, gvanrossum, scoder, vstinner, yselivanov
日期 2015-05-01.12:19:21
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1430482762.81.0.0161440712075.issue24017@psf.upfronthosting.co.za>
In-reply-to
内容
> 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.
历史
日期 用户 动作 参数
2015-05-01 12:19:22scoder修改recipients: + scoder, gvanrossum, vstinner, asvetlov, yselivanov
2015-05-01 12:19:22scoder修改messageid: <1430482762.81.0.0161440712075.issue24017@psf.upfronthosting.co.za>
2015-05-01 12:19:22scoder链接issue24017 messages
2015-05-01 12:19:22scoder创建