buffer
s can be sliced or iterated, just like other sequences.
>>> buffer('foobar')
<read-only buffer for 0x7fcdd7caa120, size -1, offset 0 at 0x7fcdd7ca82f0>
>>> buffer('foobar')[3:5]
'ba'
>>> for c in buffer('foobar'):
... print c
...
f
o
o
b
a
r