GH-145668: Add FOR_ITER specialization for virtual iterators. Specialize GET_ITER.#147967
Open
markshannon wants to merge 3 commits intopython:mainfrom
Open
GH-145668: Add FOR_ITER specialization for virtual iterators. Specialize GET_ITER.#147967markshannon wants to merge 3 commits intopython:mainfrom
markshannon wants to merge 3 commits intopython:mainfrom
Conversation
* Add FOR_ITER_VIRTUAL to specialize FOR_ITER for virtual iterators * Add GET_ITER_SELF to specialize GET_ITER for iterators (including generators) * Add GET_ITER_VIRTUAL to specialize GET_ITER for iterables as virtual iterators
Member
|
Doesn't this change the ABI guarantees of |
Member
Author
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
FOR_ITERspecialization for virtual iterators. SpecializeGET_ITER.FOR_ITER_VIRTUALto specializeFOR_ITERfor virtual iteratorsGET_ITER_SELFto specializeGET_ITERfor iterators (including generators)GET_ITER_VIRTUALto specializeGET_ITERfor iterables as virtual iteratorstp_iteriteminternal slot toPyTypeObjectto support a wider range of classes as virtual iterators.This PR adds
strs as virtual iterators, with the potential to addbytes,bytearray,frozenset,frozendictand others in the future.FOR_ITERspecializations to cover other indexable sequences #145668📚 Documentation preview 📚: https://cpython-previews--147967.org.readthedocs.build/