Message334009
Not my use case specifically, but my link in the last post (repeated below) was to a StackOverflow answer to a problem where using buffer was simple and fast, but memoryview required annoying workarounds. Admittedly, in most cases it's people wanting to do this with strings, so in Python 3 it only actually works if you convert to bytes first (possibly wrapped in a memoryview cast to a larger width if you need to support ordinals outside the latin-1 range). But it seems a valid use case.
Examples where rich comparisons were needed include:
Effcient way to find longest duplicate string for Python (From Programming Pearls) - https://stackoverflow.com/a/13574862/364696 (which provides a side-by-side comparison of code using buffer and memoryview, and memoryview lost, badly)
strcmp for python or how to sort substrings efficiently (without copy) when building a suffix array - https://stackoverflow.com/q/2282579/364696 (a case where they needed to sort based on potentially huge suffixes of huge strings, and didn't want to end up copying all of them) |
|
Date |
User |
Action |
Args |
2019-01-18 21:01:19 | josh.r | set | recipients:
+ josh.r, pitrou, fin.swimmer, remi.lapeyre |
2019-01-18 21:01:17 | josh.r | set | messageid: <1547845277.59.0.06844402795.issue20399@roundup.psfhosted.org> |
2019-01-18 21:01:17 | josh.r | link | issue20399 messages |
2019-01-18 21:01:17 | josh.r | create | |
|