sidewall icon indicating copy to clipboard operation
sidewall copied to clipboard

Add functionality to iterator returned for results

Open mhucka opened this issue 5 years ago • 0 comments

Currently, the queryresults object returned by dimensions.query(...) implements the iterator protocol and the additional ability to take the len(...) only. It would be convenient if the results object could supported slicing, and possibly other operations such as list(results). This wouldn't be very hard to implement, and the Python itertools package provides some features that could be useful in the implementation. The main design decisions revolve around how to store the results internally (when they could be very many, as many as 50,000) and what to do if the user tries to use list(results) on a long list of results (which will hang during the time that Sidewall is repeatedly querying the Dimensions server to fill out the list).

mhucka avatar Mar 16 '19 20:03 mhucka