Skip to content

Return self from iter(iterator) #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Dec 11, 2024

@hroncok hroncok force-pushed the PyObject_SelfIter branch 2 times, most recently from 2f57c77 to 33b8c1c Compare December 11, 2024 11:41
@jan-kolarik jan-kolarik self-assigned this Dec 11, 2024
@jan-kolarik
Copy link
Member

So, please correct me if I’m wrong: this essentially means we’re keeping the PyCOMPS_SeqType behavior as is, maintaining a custom iterator type for Comps sequences with our PyCOMPSSeq_getiter implementation. However, the change involves modifying the iterator object PyCOMPS_SeqIterType to use PyObject_SelfIter as the iterator type, ensuring that iter(iter(seq)) returns the iterator itself.

@hroncok
Copy link
Contributor Author

hroncok commented Dec 11, 2024

So, please correct me if I’m wrong: this essentially means we’re keeping the PyCOMPS_SeqType behavior as is, maintaining a custom iterator type for Comps sequences with our PyCOMPSSeq_getiter implementation. However, the change involves modifying the iterator object PyCOMPS_SeqIterType to use PyObject_SelfIter as the iterator type

As the __iter__ method.

ensuring that iter(iter(seq)) returns the iterator itself.

Yes.

Copy link
Member

@jan-kolarik jan-kolarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing this!

@jan-kolarik jan-kolarik merged commit c37f570 into rpm-software-management:master Dec 11, 2024
3 checks passed
@hroncok hroncok deleted the PyObject_SelfIter branch December 11, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants