Hey all, What's the best way to make a raw buffer out of a string in Python? They key requirement is that inspecting a range of characters in the resulting object does not cause a copy/allocation. Correct me if I'm wrong, but it seems like sequence types (produced by memoryview, bytearray, etc) all return a character or integer object when you access items by index.
An example usecase is a parser—you have a string buffer the user gave you, and you're iterating over each character. It would be nice not to allocate a heap object for every iteration. Hm, although, now that I'm typing this up, I'm realizing it might be a bit ridiculous to be asking for a raw char or int in Python. :S Best, Benjamin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/portland/attachments/20111031/31c13765/attachment.html> _______________________________________________ Portland mailing list [email protected] http://mail.python.org/mailman/listinfo/portland
