Skip to content
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

Implement __iter__ in Python RepeatedScalarContainer #8816

Closed
erik-hasse opened this issue Jul 15, 2021 · 6 comments
Closed

Implement __iter__ in Python RepeatedScalarContainer #8816

erik-hasse opened this issue Jul 15, 2021 · 6 comments
Assignees
Labels
inactive Denotes the issue/PR has not seen activity in the last 90 days. python

Comments

@erik-hasse
Copy link

What language does this apply to?
Python

Describe the problem you are trying to solve.
The __iter__ attribute is commonly used to check whether an object is list-like, so neglecting to include it can cause issues, for example this bug in pandas: pandas-dev/pandas#42549. This results in weird behavior where list(obj) works fine even though hasattr(obj, '__iter__') is False.

Describe the solution you'd like
The Python RepeatedScalarContainer should implement tp_iter in addition to tp_as_sequence.

Describe alternatives you've considered
Manually convert to a list every time we use RepeatedScalarContainer (list(obj)).

@erik-hasse erik-hasse changed the title Implement __iter__ in RepeatedScalarContainer Implement __iter__ in Python RepeatedScalarContainer Jul 15, 2021
@elharo elharo added the python label Aug 21, 2021
@barshaul
Copy link

@zhangskz Are there any updates on this?

@zhangskz zhangskz assigned anandolee and unassigned zhangskz May 18, 2023
@caneff
Copy link

caneff commented Nov 9, 2023

Ping on this.

Copy link

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

@github-actions github-actions bot added the inactive Denotes the issue/PR has not seen activity in the last 90 days. label Feb 20, 2024
@caneff
Copy link

caneff commented Feb 21, 2024

This is still a problem, and internally at Google we still have to patch Pandas in order to make it work with proto repeated fields. Any updates as to fixing this?

@github-actions github-actions bot removed the inactive Denotes the issue/PR has not seen activity in the last 90 days. label Feb 22, 2024
Copy link

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

@github-actions github-actions bot added the inactive Denotes the issue/PR has not seen activity in the last 90 days. label May 23, 2024
Copy link

github-actions bot commented Jun 7, 2024

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive Denotes the issue/PR has not seen activity in the last 90 days. python
Projects
None yet
Development

No branches or pull requests

6 participants