On Sun, May 27, 2001 at 09:42:30PM -0400, Tim Peters wrote: >... > [Greg Ewing] > > I think it would be safe if: > > > > 1) it kept a reference to the underlying object, and > > That much it already does. > > > 2) it re-fetched the pointer and length info each time it was > > needed, using the underlying object's buffer interface. > > If after > > b = buffer(some_object) > > b.__getitem__ needed to refetch the info between > > b[i] > and > b[i+1] > > I expect it would be so slow even Greg wouldn't want it anymore. Huh? I don't think it would be all that slow. It is just a function call. And I don't think that the getitem slot is really used all that frequently (in a loop) for buffer type objects. I've been thinking that refetching the ptr/len is the right fix. Cheers, -g -- Greg Stein, http://www.lyra.org/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4