I wrote: > if you cannot cache session data on the server side, I'd > recommend inventing a custom record format, and doing your > own parsing. turning your data into e.g. > > "foo:1:foobar:3:0+foo1:2:foobar1:3:1+foo2:2:foobar2:3:2" > > is trivial, and the resulting string can be trivially parsed by a couple > of string splits and int() calls.
on the other hand, the "myeval" function I posted here http://article.gmane.org/gmane.comp.python.general/433160 should be able to deal with your data, as well as handle data from malevolent sources without bringing down your computer. just add if token[1] == "(": out = [] token = src.next() while token[1] != ")": out.append(_parse(src, token)) token = src.next() if token[1] == ",": token = src.next() return tuple(out) after the corresponding "[" part, and call it like: data = myeval("[" + input + "]") </F> -- http://mail.python.org/mailman/listinfo/python-list