I find the first and third solutions simpler to read, and the first solution requires less memory, it probably works quite well with Psyco, and it's easy to translate to other languages (that is important for programs you want to use for a lot of time or in different situations), so I'd use the first solution.
Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list