On Thu, Mar 24, 2016 at 11:12 AM, Random832 <random...@fastmail.com> wrote: > I guess the question is, what do you _actually_ need the tail string > for? If you're using it in a loop, to pop further characters from (the > scenario that would cause it to be copying the string over lots of > times), wouldn't it make more sense to use a StringIO (or, in the real > world where your C source code isn't a string, a file) and let that > class take care of handing out characters when you ask for them? > > Like... > > fsource = StringIO(psource) > > while True: > c = fsource.read(1) > lxsymbol = disptable[min(ord(c), 256)](c, fsource)
Or... just grab an iterator off the string and call next() on it? ChrisA -- https://mail.python.org/mailman/listinfo/python-list