First script, please comment and advise

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Thu Mar 9 11:07:27 EST 2006


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




More information about the Python-list mailing list