Message244525
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.
Your contributions are welcome, but you'll need to sign the Contributors License Agreement first (found at https://www.python.org/psf/contrib/contrib-form/).
If I have misunderstood what you intended, please provide more context and an example. |
|
Date |
User |
Action |
Args |
2015-05-31 08:03:53 | ethan.furman | set | recipients:
+ ethan.furman, Rohith.PR |
2015-05-31 08:03:53 | ethan.furman | set | messageid: <1433059433.83.0.11797908978.issue24335@psf.upfronthosting.co.za> |
2015-05-31 08:03:53 | ethan.furman | link | issue24335 messages |
2015-05-31 08:03:53 | ethan.furman | create | |
|