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 yselivanov
Recipients asvetlov, scoder, vstinner, yselivanov
Date 2015-04-26.17:27:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> Could we have type slots for the new special methods? Otherwise, implementing the protocol in C would be fairly inefficient, especially for async iteration.

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.  And we don't need slots for async context managers as we don't have slots for regular ones.

What might be a good idea is to add a slot for __await__ method -- tp_await.  This will allow to implement Futures in C efficiently.  I'd rename 'tp_reserved' for this purpose.

Victor, your thoughts?
Date User Action Args
2015-04-26 17:27:56yselivanovsetrecipients: + yselivanov, scoder, vstinner, asvetlov
2015-04-26 17:27:56yselivanovsetmessageid: <>
2015-04-26 17:27:56yselivanovlinkissue24017 messages
2015-04-26 17:27:56yselivanovcreate