Re: StringIO objects sharing a buffer

2005-02-15 Thread Mathias Waack
Thomas Lotze wrote: > Is there a way for multiple StringIO objects to share a buffer of > data, or do I have to give up on subclassing StringIO for this > purpose? (An alternative would be a tokenizer class that has a > StringIO instead of being one and do the file pointer housekeeping > in there.

StringIO objects sharing a buffer

2005-02-15 Thread Thomas Lotze
Hi, I want to implement a tokenizer for some syntax. So I thought I'd subclass StringIO and make my new class return tokens on next(). However, if I want to read tokens from two places in the string in turns, I'd either need to do some housekeeping of file pointers outside the tokenizer class (wh