> class _macroString(object):
> def __init__(self,s):
> self.macro=s
> self.list=self.macro.split("\n")
> for n,v in enumerate(self.list):
> self.list[n]=v+'\n'
> def readline(self,n=[-1]):
> n[0]+=1
> return self.list[n[0]]
Why not just create a current pointer as a clas attribute?
Increment or reset as required. after all maintaining
object state is what classes and objects are for!
HTH,
Alan G.
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor