Just: > Your text split behaves completely different from the original; I think > it was intentional that any puntuation wasn't affected.
You are right, my versions is simpler but different and worse. Maybe it can be fixed a little... > Btw. I find the use of a nested function here completely bogus: you > don't need the surrounding scope. I don't agree, nested functions are useful to better structure your program: to really nest things that are logically nested, to have just one thing when you have only one thing to do, and they help you to avoid polluting the namespace (those were the main purposes of nested functions in Pascal-like languages). Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list