paleolimbot commented on PR #396: URL: https://github.com/apache/arrow-nanoarrow/pull/396#issuecomment-1988421223
> I am the least sure (or enthusiastic, that's probably the better word ;)) about adding a Scalar class. I tried very hard to avoid it because I also highly dislike whenever I arrive at a Arrow C++/pyarrow's scalar. I think once the scalar has some more functionality (e.g., getting struct children, or list elements) it will be a little more clear. The main thing I wanted to use it for, as Dane mentioned, is an abbreviated repr implementation that wasn't severely misusing iterators; however, I think they are (or will be) useful in any context where somebody is interactively exploring something. > do we think someone should ever iterate over all values of the Array as Scalar objects? Not really, no. I suppose `__iter__` could error with a message listing some more useful ways in which one could iterate over an `Array` (chunks, scalars, python objects, buffers). That would keep the concept but prevent things like `list(array)` from doing something slow and not very useful. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
