[Python-3000] Making more effective use of slice objects in Py3k (original) (raw)
Josiah Carlson jcarlson at uci.edu
Sun Aug 27 08:08:14 CEST 2006
- Previous message: [Python-3000] Making more effective use of slice objects in Py3k
- Next message: [Python-3000] Making more effective use of slice objects in Py3k
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Jim Jewett" <jimjjewett at gmail.com> wrote:
With stringviews, you wouldn't need to be reindexing from the start of the original string. The idiom would instead be a generalization of "for line in file:"
while data: chunk, sep, data = data.partition() but the partition call would not need to copy the entire string; it could simply return three views.
Also, with a little work, having string views be smart about concatenation (if two views are adjacent to each other, like chunk,sep or sep,data above, view1+view2 -> view3 on the original string), copies could further be minimized, and the earlier problem with readline, etc., can be avoided.
- Josiah
- Previous message: [Python-3000] Making more effective use of slice objects in Py3k
- Next message: [Python-3000] Making more effective use of slice objects in Py3k
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]