You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2015-05-31.08:03:53.810>created_at=<Date2015-05-31.06:53:15.228>labels= ['type-feature']
title='Provide __list__(self) along the lines of __str__(self)'updated_at=<Date2015-05-31.08:03:53.799>user='https://bugs.python.org/RohithPR'
If somebody wants their class to support being turned into a list, the obvious answer is to have that class support iteration, and there are already three ways to do that:
supply an __iter__ that returns a separate iterator
supply an __iter__/next that makes instances of the class be their own iterators
supply a __getitem__ that works with ints (0, 1, 2, ...) to return the values.
If numpy objects do not already support any of those three methods it probably means there isn't just one way to want to iterate through them, but you'll have to take that up with the numpy folks.
In the future you should discuss enhancement ideas on the Python Ideas list first.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: